Skip to content

Commit

Permalink
Add saved status setting to StartingItemGive (HarbourMasters#4600)
Browse files Browse the repository at this point in the history
  • Loading branch information
Malkierian authored Nov 30, 2024
1 parent 55960da commit 573d846
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions soh/soh/Enhancements/randomizer/savefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}

Expand Down

0 comments on commit 573d846

Please sign in to comment.