From 573d846cd7db57db9e02621660a72e17067d864b Mon Sep 17 00:00:00 2001 From: Malkierian Date: Fri, 29 Nov 2024 20:35:38 -0700 Subject: [PATCH] Add saved status setting to StartingItemGive (#4600) --- soh/soh/Enhancements/randomizer/savefile.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/savefile.cpp b/soh/soh/Enhancements/randomizer/savefile.cpp index dd6c27257..02a31e7b5 100644 --- a/soh/soh/Enhancements/randomizer/savefile.cpp +++ b/soh/soh/Enhancements/randomizer/savefile.cpp @@ -13,7 +13,10 @@ uint8_t Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey); GetItemEntry Randomizer_GetItemFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId); } -void StartingItemGive(GetItemEntry getItemEntry) { +void StartingItemGive(GetItemEntry getItemEntry, RandomizerCheck randomizerCheck) { + if (randomizerCheck != RC_MAX) { + OTRGlobals::Instance->gRandoContext->GetItemLocation(randomizerCheck)->SetCheckStatus(RCSHOW_SAVED); + } if (getItemEntry.modIndex == MOD_NONE) { if (getItemEntry.getItemId == GI_SWORD_BGS) { gSaveContext.bgsFlag = true; @@ -96,8 +99,7 @@ void GiveLinkDekuNuts(int howManyNuts) { void GiveLinksPocketItem() { if (Randomizer_GetSettingValue(RSK_LINKS_POCKET) != RO_LINKS_POCKET_NOTHING) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LINKS_POCKET, (GetItemID)RG_NONE); - StartingItemGive(getItemEntry); - Rando::Context::GetInstance()->GetItemLocation(RC_LINKS_POCKET)->SetCheckStatus(RCSHOW_SAVED); + StartingItemGive(getItemEntry, RC_LINKS_POCKET); // If we re-add the above, we'll get the item on save creation, now it's given on first load Flags_SetRandomizerInf(RAND_INF_LINKS_POCKET); } @@ -381,7 +383,7 @@ extern "C" void Randomizer_InitSaveFile() { if (Randomizer_GetSettingValue(RSK_SKIP_CHILD_ZELDA)) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_SONG_FROM_IMPA, (GetItemID)RG_ZELDAS_LULLABY); - StartingItemGive(getItemEntry); + StartingItemGive(getItemEntry, RC_SONG_FROM_IMPA); // malon/talon back at ranch Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG); @@ -403,7 +405,7 @@ extern "C" void Randomizer_InitSaveFile() { if (Randomizer_GetSettingValue(RSK_SHUFFLE_MASTER_SWORD) && startingAge == RO_AGE_ADULT) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_TOT_MASTER_SWORD, GI_NONE); - StartingItemGive(getItemEntry); + StartingItemGive(getItemEntry, RC_TOT_MASTER_SWORD); Flags_SetRandomizerInf(RAND_INF_TOT_MASTER_SWORD); }