Rando: Fix being able to get Sun's Song check multiple times (#1185)

This commit is contained in:
aMannus 2022-08-16 22:16:44 +02:00 committed by GitHub
parent 0f2e7db8e0
commit cd37a56161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -323,13 +323,9 @@ void func_80ABF708(EnOkarinaTag* this, GlobalContext* globalCtx) {
} }
void GivePlayerRandoRewardSunSong(EnOkarinaTag* song, GlobalContext* globalCtx, RandomizerCheck check) { void GivePlayerRandoRewardSunSong(EnOkarinaTag* song, GlobalContext* globalCtx, RandomizerCheck check) {
if (song->actor.parent != NULL && song->actor.parent->id == GET_PLAYER(globalCtx)->actor.id && Flags_SetTreasure(globalCtx, 0x1F);
!Flags_GetTreasure(globalCtx, 0x1F)) { GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
Flags_SetTreasure(globalCtx, 0x1F); func_8002F434(&song->actor, globalCtx, getItemId, 10000.0f, 100.0f);
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
func_8002F434(&song->actor, globalCtx, getItemId, 10000.0f, 100.0f);
}
} }
void func_80ABF7CC(EnOkarinaTag* this, GlobalContext* globalCtx) { void func_80ABF7CC(EnOkarinaTag* this, GlobalContext* globalCtx) {
@ -338,15 +334,11 @@ void func_80ABF7CC(EnOkarinaTag* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(globalCtx)) { if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(globalCtx)) {
Message_CloseTextbox(globalCtx); Message_CloseTextbox(globalCtx);
if (!gSaveContext.n64ddFlag) { if (!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_SONG_SUN)) {
if (!CHECK_QUEST_ITEM(QUEST_SONG_SUN)) { globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gSunSongGraveSunSongTeachCs);
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gSunSongGraveSunSongTeachCs); gSaveContext.cutsceneTrigger = 1;
gSaveContext.cutsceneTrigger = 1; } else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
} GivePlayerRandoRewardSunSong(this, globalCtx, RC_SONG_FROM_ROYAL_FAMILYS_TOMB);
} else {
if (!Flags_GetTreasure(globalCtx, 0x1F)) {
GivePlayerRandoRewardSunSong(this, globalCtx, RC_SONG_FROM_ROYAL_FAMILYS_TOMB);
}
} }
this->actionFunc = func_80ABF708; this->actionFunc = func_80ABF708;
} }