From 33c74a10b7e31e5e54073f2a81971e31b497f2ef Mon Sep 17 00:00:00 2001 From: Pepper0ni <93387759+Pepper0ni@users.noreply.github.com> Date: Thu, 3 Oct 2024 01:27:43 +0100 Subject: [PATCH] Fix items being placed on hint locations (#4379) --- .../Enhancements/randomizer/3drando/fill.cpp | 2 +- .../Enhancements/randomizer/location_list.cpp | 18 +++++++++++++++++- soh/soh/Enhancements/randomizer/static_data.h | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/fill.cpp b/soh/soh/Enhancements/randomizer/3drando/fill.cpp index 08861f7b4..1a7e2cad8 100644 --- a/soh/soh/Enhancements/randomizer/3drando/fill.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/fill.cpp @@ -1023,7 +1023,7 @@ static void RandomizeDungeonItems() { auto ctx = Rando::Context::GetInstance(); //Get Any Dungeon and Overworld group locations - std::vector anyDungeonLocations = FilterFromPool(ctx->allLocations, [](const auto loc){return Rando::StaticData::GetLocation(loc)->IsDungeon();}); + std::vector anyDungeonLocations = Rando::StaticData::GetDungeonLocations(); //Rando::StaticData::GetOverworldLocations() defined in item_location.cpp //Create Any Dungeon and Overworld item pools diff --git a/soh/soh/Enhancements/randomizer/location_list.cpp b/soh/soh/Enhancements/randomizer/location_list.cpp index 55fac81d4..9b2b3b0a7 100644 --- a/soh/soh/Enhancements/randomizer/location_list.cpp +++ b/soh/soh/Enhancements/randomizer/location_list.cpp @@ -82,7 +82,23 @@ std::vector Rando::StaticData::GetOverworldLocations() { location.GetRandomizerCheck() != RC_UNKNOWN_CHECK && location.GetRandomizerCheck() != RC_TRIFORCE_COMPLETED && //not really an overworld check location.GetRCType() != RCTYPE_FISH && //temp fix while locations are properly sorted out - location.GetRCType() != RCTYPE_CHEST_GAME //this is supposed to be excluded + location.GetRCType() != RCTYPE_CHEST_GAME && //this is supposed to be excluded + location.GetRCType() != RCTYPE_STATIC_HINT && + location.GetRCType() != RCTYPE_GOSSIP_STONE //don't put items on hints + ) { + overworldLocations.push_back(location.GetRandomizerCheck()); + } + } + return overworldLocations; +} + +std::vector Rando::StaticData::GetDungeonLocations() { + std::vector overworldLocations = {}; + for (Location& location : locationTable) { + if ( + location.IsDungeon() && + location.GetRCType() != RCTYPE_STATIC_HINT && + location.GetRCType() != RCTYPE_GOSSIP_STONE //don't put items on hints ) { overworldLocations.push_back(location.GetRandomizerCheck()); } diff --git a/soh/soh/Enhancements/randomizer/static_data.h b/soh/soh/Enhancements/randomizer/static_data.h index 1a76fd276..c2831324b 100644 --- a/soh/soh/Enhancements/randomizer/static_data.h +++ b/soh/soh/Enhancements/randomizer/static_data.h @@ -36,6 +36,7 @@ class StaticData { static std::unordered_map PopulateTranslationMap(std::unordered_map input); static std::multimap, RandomizerCheck> CheckFromActorMultimap; static std::vector GetOverworldLocations(); + static std::vector GetDungeonLocations(); static std::vector dungeonRewardLocations; static std::vector GetShopLocations(); static std::vector GetScrubLocations();