Shuffle Fairies - Fix fairies spawning without playing song (#4884)

* Fix fairies spawning without playing song

* Better if statement
This commit is contained in:
aMannus 2025-01-15 23:12:06 +01:00 committed by GitHub
parent 0497ad20d8
commit 5ae527c194
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -129,20 +129,15 @@ void ShuffleFairies_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should,
} else if (id == VB_SPAWN_GOSSIP_STONE_FAIRY) { } else if (id == VB_SPAWN_GOSSIP_STONE_FAIRY) {
EnGs* gossipStone = (EnGs*)(actor); EnGs* gossipStone = (EnGs*)(actor);
// If not any of the songs that normally spawn a fairy, mimic vanilla behaviour. // Mimic vanilla behaviour, only go into this path if song played is one of the ones normally spawning a fairy.
if (gPlayState->msgCtx.ocarinaMode == OCARINA_MODE_01) { // Otherwise fall back to vanilla behaviour.
Player* player = GET_PLAYER(gPlayState); if (gPlayState->msgCtx.ocarinaMode == OCARINA_MODE_04 &&
player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; (gPlayState->msgCtx.unk_E3F2 == OCARINA_SONG_LULLABY ||
return; gPlayState->msgCtx.unk_E3F2 == OCARINA_SONG_SARIAS ||
} else if (gPlayState->msgCtx.unk_E3F2 != OCARINA_SONG_LULLABY && gPlayState->msgCtx.unk_E3F2 == OCARINA_SONG_EPONAS ||
gPlayState->msgCtx.unk_E3F2 != OCARINA_SONG_SARIAS && gPlayState->msgCtx.unk_E3F2 == OCARINA_SONG_SUNS ||
gPlayState->msgCtx.unk_E3F2 != OCARINA_SONG_EPONAS && gPlayState->msgCtx.unk_E3F2 == OCARINA_SONG_TIME ||
gPlayState->msgCtx.unk_E3F2 != OCARINA_SONG_SUNS && gPlayState->msgCtx.unk_E3F2 == OCARINA_SONG_STORMS)) {
gPlayState->msgCtx.unk_E3F2 != OCARINA_SONG_TIME &&
gPlayState->msgCtx.unk_E3F2 != OCARINA_SONG_STORMS &&
gPlayState->msgCtx.ocarinaMode != OCARINA_MODE_04) {
return;
}
int32_t params = (gPlayState->sceneNum == SCENE_GROTTOS) ? Grotto_CurrentGrotto() : 0; int32_t params = (gPlayState->sceneNum == SCENE_GROTTOS) ? Grotto_CurrentGrotto() : 0;
// Distinguish storms fairies from the normal song fairies // Distinguish storms fairies from the normal song fairies
@ -171,6 +166,7 @@ void ShuffleFairies_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should,
*should = false; *should = false;
} }
} }
}
} }
uint32_t onVanillaBehaviorHook = 0; uint32_t onVanillaBehaviorHook = 0;