Add saved status setting to StartingItemGive (#4600)

This commit is contained in:
Malkierian 2024-11-29 20:35:38 -07:00 committed by GitHub
parent 55960da402
commit 573d846cd7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,7 +13,10 @@ uint8_t Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey);
GetItemEntry Randomizer_GetItemFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId); 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.modIndex == MOD_NONE) {
if (getItemEntry.getItemId == GI_SWORD_BGS) { if (getItemEntry.getItemId == GI_SWORD_BGS) {
gSaveContext.bgsFlag = true; gSaveContext.bgsFlag = true;
@ -96,8 +99,7 @@ void GiveLinkDekuNuts(int howManyNuts) {
void GiveLinksPocketItem() { void GiveLinksPocketItem() {
if (Randomizer_GetSettingValue(RSK_LINKS_POCKET) != RO_LINKS_POCKET_NOTHING) { if (Randomizer_GetSettingValue(RSK_LINKS_POCKET) != RO_LINKS_POCKET_NOTHING) {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LINKS_POCKET, (GetItemID)RG_NONE); GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LINKS_POCKET, (GetItemID)RG_NONE);
StartingItemGive(getItemEntry); StartingItemGive(getItemEntry, RC_LINKS_POCKET);
Rando::Context::GetInstance()->GetItemLocation(RC_LINKS_POCKET)->SetCheckStatus(RCSHOW_SAVED);
// If we re-add the above, we'll get the item on save creation, now it's given on first load // 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); Flags_SetRandomizerInf(RAND_INF_LINKS_POCKET);
} }
@ -381,7 +383,7 @@ extern "C" void Randomizer_InitSaveFile() {
if (Randomizer_GetSettingValue(RSK_SKIP_CHILD_ZELDA)) { if (Randomizer_GetSettingValue(RSK_SKIP_CHILD_ZELDA)) {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_SONG_FROM_IMPA, (GetItemID)RG_ZELDAS_LULLABY); 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 // malon/talon back at ranch
Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG); 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) { if (Randomizer_GetSettingValue(RSK_SHUFFLE_MASTER_SWORD) && startingAge == RO_AGE_ADULT) {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_TOT_MASTER_SWORD, GI_NONE); 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); Flags_SetRandomizerInf(RAND_INF_TOT_MASTER_SWORD);
} }