diff --git a/soh/soh/Enhancements/randomizer/RCToRandInf.cpp b/soh/soh/Enhancements/randomizer/RCToRandInf.cpp index 5a5072039a6..304ff9f8249 100644 --- a/soh/soh/Enhancements/randomizer/RCToRandInf.cpp +++ b/soh/soh/Enhancements/randomizer/RCToRandInf.cpp @@ -1,4 +1,5 @@ #include "./RCToRandInf.h" +#include "soh/Enhancements/randomizer/randomizerEnums.h" std::map rcToRandomizerInf = { { RC_KF_LINKS_HOUSE_COW, RAND_INF_COWS_MILKED_KF_LINKS_HOUSE_COW }, @@ -2413,6 +2414,7 @@ std::map rcToRandomizerInf = { { RC_SPIRIT_TEMPLE_MQ_ENTRANCE_EYE_BOULDER, RAND_INF_SPIRIT_TEMPLE_MQ_ENTRANCE_EYE_BOULDER }, { RC_SPIRIT_TEMPLE_MQ_ENTRANCE_CEILING_BOULDER, RAND_INF_SPIRIT_TEMPLE_MQ_ENTRANCE_CEILING_BOULDER }, { RC_SPIRIT_TEMPLE_MQ_EARLY_ADULT_BOULDER, RAND_INF_SPIRIT_TEMPLE_MQ_EARLY_ADULT_BOULDER }, + { RC_SPIRIT_TEMPLE_MQ_CRAWLSPACE_BOULDER, RAND_INF_SPIRIT_TEMPLE_MQ_CRAWLSPACE_BOULDER }, { RC_BOTW_MQ_BOULDER_1, RAND_INF_BOTW_MQ_BOULDER_1 }, { RC_BOTW_MQ_BOULDER_2, RAND_INF_BOTW_MQ_BOULDER_2 }, { RC_BOTW_MQ_BOULDER_3, RAND_INF_BOTW_MQ_BOULDER_3 }, diff --git a/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp b/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp index b6fda51df28..60d73f691ef 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp @@ -95,7 +95,12 @@ static CheckIdentity IdentifyBeehive(s32 sceneNum, s16 xPosition, s32 respawnDat OTRGlobals::Instance->gRandomizer->GetCheckObjectFromActor(ACTOR_OBJ_COMB, sceneNum, respawnData); if (location->GetRandomizerCheck() != RC_UNKNOWN_CHECK) { - beehiveIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + beehiveIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } beehiveIdentity.randomizerCheck = location->GetRandomizerCheck(); } diff --git a/soh/soh/Enhancements/randomizer/ShuffleBeggar.cpp b/soh/soh/Enhancements/randomizer/ShuffleBeggar.cpp index 6389be71d15..fc7b161af72 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleBeggar.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleBeggar.cpp @@ -18,7 +18,12 @@ static CheckIdentity IdentifyBeggar(s32 sceneNum, s32 textId) { if (location->GetRandomizerCheck() == RC_UNKNOWN_CHECK) { LUSLOG_WARN("IdentifyBeggar did not receive a valid RC value (%d).", location->GetRandomizerCheck()); } else { - beggarIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + beggarIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } beggarIdentity.randomizerCheck = location->GetRandomizerCheck(); } diff --git a/soh/soh/Enhancements/randomizer/ShuffleCows.cpp b/soh/soh/Enhancements/randomizer/ShuffleCows.cpp index 8df4959d655..3afd8103165 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleCows.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleCows.cpp @@ -52,7 +52,12 @@ static CheckIdentity IdentifyCow(s32 sceneNum, s32 posX, s32 posZ) { OTRGlobals::Instance->gRandomizer->GetCheckObjectFromActor(ACTOR_EN_COW, sceneNum, actorParams); if (location->GetRandomizerCheck() != RC_UNKNOWN_CHECK) { - cowIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + cowIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } cowIdentity.randomizerCheck = location->GetRandomizerCheck(); } diff --git a/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp b/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp index e3738e21263..c3d6c91cc8f 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp @@ -212,7 +212,12 @@ static CheckIdentity IdentifyCrate(s32 sceneNum, s32 posX, s32 posZ) { LUSLOG_WARN("IdentifyCrate did not receive a valid RC value (%d).", location->GetRandomizerCheck()); assert(false); } else { - crateIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + crateIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } crateIdentity.randomizerCheck = location->GetRandomizerCheck(); } @@ -235,7 +240,12 @@ static CheckIdentity IdentifySmallCrate(s32 sceneNum, s32 posX, s32 posZ) { LUSLOG_WARN("IdentifyCrate did not receive a valid RC value (%d).", location->GetRandomizerCheck()); assert(false); } else { - smallCrateIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + smallCrateIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } smallCrateIdentity.randomizerCheck = location->GetRandomizerCheck(); } diff --git a/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp b/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp index a065cbdbe54..f77c47520d3 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp @@ -173,7 +173,12 @@ static CheckIdentity IdentifyGrass(s32 sceneNum, s32 posX, s32 posZ, s32 respawn OTRGlobals::Instance->gRandomizer->GetCheckObjectFromActor(ACTOR_EN_KUSA, sceneNum, respawnData); if (location->GetRandomizerCheck() != RC_UNKNOWN_CHECK) { - grassIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + grassIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } grassIdentity.randomizerCheck = location->GetRandomizerCheck(); } diff --git a/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp b/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp index f972d3b1b8c..57466dceecf 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp @@ -108,7 +108,12 @@ static CheckIdentity IdentifyIcicle(s32 sceneNum, s32 posX, s32 posZ) { LUSLOG_WARN("IdentifyIcicle did not receive a valid RC value (%d).", location->GetRandomizerCheck()); assert(false); } else { - icicleIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + icicleIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } icicleIdentity.randomizerCheck = location->GetRandomizerCheck(); } diff --git a/soh/soh/Enhancements/randomizer/ShufflePots.cpp b/soh/soh/Enhancements/randomizer/ShufflePots.cpp index 2ad42114425..e0564451c31 100644 --- a/soh/soh/Enhancements/randomizer/ShufflePots.cpp +++ b/soh/soh/Enhancements/randomizer/ShufflePots.cpp @@ -121,7 +121,12 @@ static CheckIdentity IdentifyPot(s32 sceneNum, s32 posX, s32 posZ) { if (location->GetRandomizerCheck() == RC_UNKNOWN_CHECK) { LUSLOG_WARN("IdentifyPot did not receive a valid RC value (%d).", location->GetRandomizerCheck()); } else { - potIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + potIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } potIdentity.randomizerCheck = location->GetRandomizerCheck(); } diff --git a/soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp b/soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp index c3d4d00297d..9a1fead9ac3 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp @@ -146,7 +146,12 @@ static CheckIdentity IdentifyRedIce(s32 sceneNum, s32 posX, s32 posZ) { LUSLOG_WARN("IdentifyRedIce did not receive a valid RC value (%d).", location->GetRandomizerCheck()); assert(false); } else { - redIceIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + redIceIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } redIceIdentity.randomizerCheck = location->GetRandomizerCheck(); } diff --git a/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp b/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp index a227919322c..30b262d8a63 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp @@ -1,4 +1,5 @@ #include "ShuffleRocks.h" +#include "libultraship/log/luslog.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "static_data.h" #include "soh/ObjectExtension/ObjectExtension.h" @@ -217,7 +218,12 @@ static CheckIdentity IdentifyRock(s32 sceneNum, s32 posX, s32 posZ) { ACTOR_EN_ISHI, sceneNum, TWO_ACTOR_PARAMS(posX, posZ)); if (location->GetRandomizerCheck() != RC_UNKNOWN_CHECK) { - rockIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + rockIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } rockIdentity.randomizerCheck = location->GetRandomizerCheck(); } else { LUSLOG_WARN("IdentifyRock did not receive a valid RC value %d,%d.", posX, posZ); diff --git a/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp b/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp index 445fdc8456a..4833e2af314 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp @@ -160,7 +160,12 @@ static CheckIdentity IdentifySign(s32 sceneNum, s32 posX, s32 posZ, s32 id) { if (location == nullptr || location->GetRandomizerCheck() == RC_UNKNOWN_CHECK) { LUSLOG_WARN("IdentifySign did not receive a valid RC value (%d).", location->GetRandomizerCheck()); } else { - signIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + signIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } signIdentity.randomizerCheck = location->GetRandomizerCheck(); } diff --git a/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp b/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp index c26e79d1e6f..4dd8263b8d6 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp @@ -138,7 +138,12 @@ static CheckIdentity IdentifyTree(s32 sceneNum, s32 posX, s32 posZ) { if (location->GetRandomizerCheck() != RC_UNKNOWN_CHECK && (location->GetRCType() != RCTYPE_NLTREE || OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_LOGIC_RULES) == RO_LOGIC_NO_LOGIC)) { - treeIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + treeIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } treeIdentity.randomizerCheck = location->GetRandomizerCheck(); return treeIdentity; } diff --git a/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp b/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp index 855ef0bba42..f0124fb9ff4 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp @@ -123,7 +123,12 @@ static CheckIdentity IdentifyWonderItem(s32 sceneNum, s32 par1, s32 par2) { if (location->GetRandomizerCheck() == RC_UNKNOWN_CHECK) { LUSLOG_WARN("IdentifyWonderItem did not receive a valid RC value (%d).", location->GetRandomizerCheck()); } else { - wonderIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + wonderIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } wonderIdentity.randomizerCheck = location->GetRandomizerCheck(); } diff --git a/soh/soh/Enhancements/randomizer/fishsanity.cpp b/soh/soh/Enhancements/randomizer/fishsanity.cpp index 204a8062f50..53fc491c1d3 100644 --- a/soh/soh/Enhancements/randomizer/fishsanity.cpp +++ b/soh/soh/Enhancements/randomizer/fishsanity.cpp @@ -270,7 +270,12 @@ static CheckIdentity IdentifyFish(s32 sceneNum, s32 actorParams) { OTRGlobals::Instance->gRandomizer->GetCheckObjectFromActor(ACTOR_EN_FISH, sceneNum, actorParams); if (location->GetRandomizerCheck() != RC_UNKNOWN_CHECK) { - fishIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + fishIdentity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } fishIdentity.randomizerCheck = location->GetRandomizerCheck(); } diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index c1479843509..3a952c9a9bc 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -969,8 +969,12 @@ static ScrubIdentity IdentifyScrub(s32 sceneNum, s32 actorParams, s32 respawnDat } else if (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) != RO_SCRUBS_ALL) { return scrubIdentity; } - - scrubIdentity.identity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + scrubIdentity.identity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } scrubIdentity.identity.randomizerCheck = location->GetRandomizerCheck(); scrubIdentity.getItemId = (GetItemID)Rando::StaticData::RetrieveItem(location->GetVanillaItem()).GetItemID(); scrubIdentity.itemPrice = diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 8f8ade08fc2..1e3cdd60921 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -838,7 +838,12 @@ ShopItemIdentity Randomizer::IdentifyShopItem(s32 sceneNum, u8 slotIndex) { slotIndex - 1); if (location->GetRandomizerCheck() != RC_UNKNOWN_CHECK) { - shopItemIdentity.identity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + if (rcToRandomizerInf.contains(location->GetRandomizerCheck())) { + shopItemIdentity.identity.randomizerInf = rcToRandomizerInf[location->GetRandomizerCheck()]; + } else { + LUSLOG_ERROR("%d not found in rcToRandomizerInf.", location->GetRandomizerCheck()); + assert(false); + } shopItemIdentity.identity.randomizerCheck = location->GetRandomizerCheck(); shopItemIdentity.ogItemId = (GetItemID)Rando::StaticData::RetrieveItem(location->GetVanillaItem()).GetItemID();