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,14 +323,10 @@ 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_GetTreasure(globalCtx, 0x1F)) {
Flags_SetTreasure(globalCtx, 0x1F); Flags_SetTreasure(globalCtx, 0x1F);
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_LETTER_ZELDA); GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
func_8002F434(&song->actor, globalCtx, getItemId, 10000.0f, 100.0f); func_8002F434(&song->actor, globalCtx, getItemId, 10000.0f, 100.0f);
} }
}
void func_80ABF7CC(EnOkarinaTag* this, GlobalContext* globalCtx) { void func_80ABF7CC(EnOkarinaTag* this, GlobalContext* globalCtx) {
// "Open sesame sesame!" // "Open sesame sesame!"
@ -338,16 +334,12 @@ 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)) {
} else {
if (!Flags_GetTreasure(globalCtx, 0x1F)) {
GivePlayerRandoRewardSunSong(this, globalCtx, RC_SONG_FROM_ROYAL_FAMILYS_TOMB); GivePlayerRandoRewardSunSong(this, globalCtx, RC_SONG_FROM_ROYAL_FAMILYS_TOMB);
} }
}
this->actionFunc = func_80ABF708; this->actionFunc = func_80ABF708;
} }
} }