mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-10-31 23:55:06 -04:00
Fix for LACS awarding everywhere (#4348)
* Fix for LACS awarding everywhere * Update soh/soh/Enhancements/randomizer/hook_handlers.cpp Co-authored-by: Pepe20129 <72659707+Pepe20129@users.noreply.github.com> --------- Co-authored-by: Pepe20129 <72659707+Pepe20129@users.noreply.github.com>
This commit is contained in:
parent
ee02e503fc
commit
2434eb82bf
@ -637,7 +637,11 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void
|
||||
*should = !Flags_GetRandomizerInf(RAND_INF_DARUNIAS_JOY);
|
||||
break;
|
||||
case VB_BE_ELIGIBLE_FOR_LIGHT_ARROWS:
|
||||
*should = !Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) && MeetsLACSRequirements();
|
||||
*should =
|
||||
LINK_IS_ADULT &&
|
||||
(gEntranceTable[gSaveContext.entranceIndex].scene == SCENE_TEMPLE_OF_TIME) &&
|
||||
!Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) &&
|
||||
MeetsLACSRequirements();
|
||||
break;
|
||||
case VB_BE_ELIGIBLE_FOR_NOCTURNE_OF_SHADOW:
|
||||
*should =
|
||||
@ -1212,6 +1216,7 @@ void RandomizerOnSceneInitHandler(int16_t sceneNum) {
|
||||
updateHook = 0;
|
||||
}
|
||||
|
||||
// If we're not in the Temple of Time or we've already learned the Prelude of Light and received LACs, we don't need to do anything
|
||||
if (
|
||||
sceneNum != SCENE_TEMPLE_OF_TIME ||
|
||||
(
|
||||
@ -1225,15 +1230,18 @@ void RandomizerOnSceneInitHandler(int16_t sceneNum) {
|
||||
Flags_SetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT);
|
||||
}
|
||||
|
||||
if (!Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) && MeetsLACSRequirements()) {
|
||||
// We're always in rando here, and rando always overrides this should so we can just pass false
|
||||
if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_LIGHT_ARROWS, false, NULL)) {
|
||||
Flags_SetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS);
|
||||
}
|
||||
|
||||
// If both awards have been given, we can unregister the hook, otherwise it will get unregistered when the player leaves the area
|
||||
if (
|
||||
Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) &&
|
||||
Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS)
|
||||
) {
|
||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnPlayerUpdate>(updateHook);
|
||||
updateHook = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user