From 5d311fac9fb49dfe63790a66a85602171892814b Mon Sep 17 00:00:00 2001 From: Archez Date: Tue, 8 Oct 2024 23:20:09 -0400 Subject: [PATCH] Convert GameInteractor_Should hook to use variadic arguments (#4383) * Convert _Should to use variadic args * Convert everything to use va_arg properly * Update shop hooks to va_args * Wrong Function * Update hook_handlers.cpp --------- Co-authored-by: Malkierian Co-authored-by: Malkierian --- .../TimeSavers/FasterHeavyBlockLift.cpp | 6 +- .../SkipCutscene/Story/SkipBlueWarp.cpp | 8 +-- .../SkipCutscene/Story/SkipDekuTreeIntro.cpp | 2 +- .../Story/SkipLostWoodsBridge.cpp | 2 +- .../Story/SkipZeldaFleeingCastle.cpp | 2 +- soh/soh/Enhancements/boss-rush/BossRush.cpp | 19 +++-- soh/soh/Enhancements/cheat_hook_handlers.cpp | 2 +- .../game-interactor/GameInteractor.h | 11 ++- .../GameInteractor_HookTable.h | 4 +- .../game-interactor/GameInteractor_Hooks.cpp | 27 ++++--- .../game-interactor/GameInteractor_Hooks.h | 3 +- .../Enhancements/randomizer/fishsanity.cpp | 11 ++- soh/soh/Enhancements/randomizer/fishsanity.h | 4 +- .../Enhancements/randomizer/hook_handlers.cpp | 70 ++++++++++--------- .../Enhancements/timesaver_hook_handlers.cpp | 57 ++++++++------- soh/src/code/code_800EC960.c | 10 +-- soh/src/code/z_demo.c | 20 +++--- soh/src/code/z_horse.c | 6 +- soh/src/code/z_message_PAL.c | 24 +++---- soh/src/code/z_parameter.c | 6 +- soh/src/code/z_sram.c | 2 +- .../actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 2 +- .../ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c | 6 +- .../ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c | 4 +- .../actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c | 2 +- .../actors/ovl_Boss_Dodongo/z_boss_dodongo.c | 4 +- .../overlays/actors/ovl_Boss_Fd/z_boss_fd.c | 4 +- .../actors/ovl_Boss_Ganon/z_boss_ganon.c | 2 +- .../ovl_Boss_Ganondrof/z_boss_ganondrof.c | 6 +- .../actors/ovl_Boss_Goma/z_boss_goma.c | 4 +- .../overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 4 +- .../overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 4 +- .../overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 4 +- .../overlays/actors/ovl_Boss_Va/z_boss_va.c | 4 +- .../overlays/actors/ovl_Demo_Du/z_demo_du.c | 6 +- .../overlays/actors/ovl_Demo_Im/z_demo_im.c | 6 +- .../overlays/actors/ovl_Demo_Sa/z_demo_sa.c | 4 +- soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c | 6 +- .../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 2 +- soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c | 2 +- soh/src/overlays/actors/ovl_En_Du/z_en_du.c | 8 +-- soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 8 +-- soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 12 ++-- soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c | 4 +- soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c | 2 +- soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c | 56 +++++++-------- soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c | 2 +- .../actors/ovl_En_Kakasi2/z_en_kakasi2.c | 2 +- soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c | 2 +- soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c | 18 ++--- soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c | 2 +- soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c | 4 +- soh/src/overlays/actors/ovl_En_Rl/z_en_rl.c | 2 +- soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 4 +- soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c | 6 +- .../overlays/actors/ovl_En_Toryo/z_en_toryo.c | 2 +- soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c | 30 ++++---- soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c | 2 +- soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c | 4 +- .../actors/ovl_Item_Ocarina/z_item_ocarina.c | 4 +- .../actors/ovl_player_actor/z_player.c | 16 ++--- .../ovl_kaleido_scope/z_kaleido_collect.c | 10 +-- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 6 +- 63 files changed, 308 insertions(+), 270 deletions(-) diff --git a/soh/soh/Enhancements/TimeSavers/FasterHeavyBlockLift.cpp b/soh/soh/Enhancements/TimeSavers/FasterHeavyBlockLift.cpp index ca73877c6..73909cbda 100644 --- a/soh/soh/Enhancements/TimeSavers/FasterHeavyBlockLift.cpp +++ b/soh/soh/Enhancements/TimeSavers/FasterHeavyBlockLift.cpp @@ -18,7 +18,7 @@ extern "C" { */ void FasterHeavyBlockLift_Register() { REGISTER_VB_SHOULD(VB_PLAY_ONEPOINT_ACTOR_CS, { - Actor* actor = static_cast(opt); + Actor* actor = va_arg(args, Actor*); if ( actor->id == ACTOR_BG_HEAVY_BLOCK && @@ -38,7 +38,7 @@ void FasterHeavyBlockLift_Register() { Player *player = GET_PLAYER(gPlayState); Actor* interactRangeActor = player->interactRangeActor; s32 interactActorId = interactRangeActor->id; - LinkAnimationHeader* anim = static_cast(opt); + LinkAnimationHeader* anim = va_arg(args, LinkAnimationHeader*); // Same actor is used for small and large silver rocks, use actor params to identify large ones bool isLargeSilverRock = interactActorId == ACTOR_EN_ISHI && interactRangeActor->params & 1 == 1; @@ -50,7 +50,7 @@ void FasterHeavyBlockLift_Register() { REGISTER_VB_SHOULD(VB_MOVE_THROWN_ACTOR, { if (CVarGetInteger(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 0)) { - Actor* heldActor = static_cast(opt); + Actor* heldActor = va_arg(args, Actor*); heldActor->shape.rot.x -= 3510; } diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp index 27dc30ae9..748982843 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp @@ -17,7 +17,7 @@ extern "C" { * set the entrance index to where you would normally end up after the blue warp cutscene. This * should also account for the difference between your first and following visits to the blue warp. */ -void SkipBlueWarp_ShouldPlayTransitionCS(GIVanillaBehavior _, bool* should, void* opt) { +void SkipBlueWarp_ShouldPlayTransitionCS(GIVanillaBehavior _, bool* should, va_list originalArgs) { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { uint8_t isBlueWarpCutscene = 0; // Deku Tree Blue warp @@ -91,7 +91,7 @@ void SkipBlueWarp_ShouldPlayTransitionCS(GIVanillaBehavior _, bool* should, void * received the item when skipping the blue warp cutscene, so we'll prevent that and queue it up to be given * to the player instead. */ -void SkipBlueWarp_ShouldGiveItem(GIVanillaBehavior _, bool* should, void* opt) { +void SkipBlueWarp_ShouldGiveItem(GIVanillaBehavior _, bool* should, va_list originalArgs) { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { *should = false; } @@ -108,7 +108,7 @@ void EnKo_MoveWhenReady(EnKo* enKo, PlayState* play) { func_80A995CC(enKo, play); if ((enKo->actor.params & 0xFF) == ENKO_TYPE_CHILD_3) { - if (GameInteractor_Should(VB_OPEN_KOKIRI_FOREST, CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD), NULL)) { + if (GameInteractor_Should(VB_OPEN_KOKIRI_FOREST, CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD))) { enKo->collider.dim.height -= 200; Path_CopyLastPoint(enKo->path, &enKo->actor.world.pos); enKo->actionFunc = func_80A99384; @@ -132,7 +132,7 @@ void SkipBlueWarp_OnActorUpdate(void* actorPtr) { * This will ensure that the Deku Tree Sprout considers the Forest Temple finished when you skip the blue warp cutscene. * Typically this checks for if you have the medallion, and when skipping the cutscene at this point you don't have it yet. */ -void SkipBlueWarp_ShouldDekuJrConsiderForestTempleFinished(GIVanillaBehavior _, bool* should, void* opt) { +void SkipBlueWarp_ShouldDekuJrConsiderForestTempleFinished(GIVanillaBehavior _, bool* should, va_list originalArgs) { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { if (gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_11 && gSaveContext.cutsceneIndex == 0xFFF1) { *should = Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP); diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipDekuTreeIntro.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipDekuTreeIntro.cpp index bac84cb63..7000aa391 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipDekuTreeIntro.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipDekuTreeIntro.cpp @@ -12,7 +12,7 @@ extern "C" { void SkipDekuTreeIntro_Register() { REGISTER_VB_SHOULD(VB_PLAY_DEKU_TREE_INTRO_CS, { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { - BgTreemouth* treeMouth = static_cast(opt); + BgTreemouth* treeMouth = va_arg(args, BgTreemouth*); Flags_SetEventChkInf(EVENTCHKINF_DEKU_TREE_OPENED_MOUTH); Audio_PlaySoundGeneral(NA_SE_EV_WOODDOOR_OPEN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); BgTreemouth_SetupAction(treeMouth, func_808BC6F8); diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp index f447b7386..7fa7b99f6 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp @@ -17,7 +17,7 @@ void SkipLostWoodsBridge_Register() { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { if ((gSaveContext.entranceIndex == ENTR_LOST_WOODS_9) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE)) { Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE); - if (GameInteractor_Should(VB_GIVE_ITEM_FAIRY_OCARINA, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_FAIRY_OCARINA, true)) { Item_Give(gPlayState, ITEM_OCARINA_FAIRY); } *should = false; diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp index 48cc80aa7..fe578c831 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp @@ -8,7 +8,7 @@ extern "C" { extern SaveContext gSaveContext; } -void SkipZeldaFleeingCastle_ShouldPlayTransitionCS(GIVanillaBehavior _, bool* should, void* opt) { +void SkipZeldaFleeingCastle_ShouldPlayTransitionCS(GIVanillaBehavior _, bool* should, va_list originalArgs) { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { if (gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_0 && gSaveContext.cutsceneIndex == 0xFFF1) { // Normally set in the cutscene diff --git a/soh/soh/Enhancements/boss-rush/BossRush.cpp b/soh/soh/Enhancements/boss-rush/BossRush.cpp index 51fd4db27..c83078581 100644 --- a/soh/soh/Enhancements/boss-rush/BossRush.cpp +++ b/soh/soh/Enhancements/boss-rush/BossRush.cpp @@ -509,7 +509,10 @@ static void* sSavePromptNoChoiceTexs[] = { (void*)gPauseNoFRATex }; -void BossRush_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* optionalArg) { +void BossRush_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_list originalArgs) { + va_list args; + va_copy(args, originalArgs); + switch (id) { // Allow not healing before ganon case VB_GANON_HEAL_BEFORE_FIGHT: { @@ -520,7 +523,7 @@ void BossRush_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* } // Replace the blue warp transitions with ones that lead back to the chamber of sages case VB_BLUE_WARP_APPLY_ENTRANCE_AND_CUTSCENE: { - DoorWarp1* blueWarp = static_cast(optionalArg); + DoorWarp1* blueWarp = va_arg(args, DoorWarp1*); BossRush_HandleBlueWarp(gPlayState, blueWarp->actor.world.pos.x, blueWarp->actor.world.pos.z); *should = false; break; @@ -529,7 +532,7 @@ void BossRush_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* case VB_SPAWN_BLUE_WARP: { switch (gPlayState->sceneNum) { case SCENE_DEKU_TREE_BOSS: { - BossGoma* bossGoma = static_cast(optionalArg); + BossGoma* bossGoma = va_arg(args, BossGoma*); static Vec3f roomCenter = { -150.0f, 0.0f, -350.0f }; Vec3f childPos = roomCenter; @@ -578,7 +581,7 @@ void BossRush_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* break; } case SCENE_WATER_TEMPLE_BOSS: { - BossMo* bossMo = static_cast(optionalArg); + BossMo* bossMo = va_arg(args, BossMo*); Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_DOOR_WARP1, bossMo->actor.world.pos.x, -280.0f, bossMo->actor.world.pos.z, 0, 0, 0, WARP_DUNGEON_ADULT, true); break; } @@ -607,7 +610,7 @@ void BossRush_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* } // Show "No" twice because the player can't continue. case VB_RENDER_YES_ON_CONTINUE_PROMPT: { - Gfx** disp = static_cast(optionalArg); + Gfx** disp = va_arg(args, Gfx**); *disp = KaleidoScope_QuadTextureIA8(*disp, sSavePromptNoChoiceTexs[gSaveContext.language], 48, 16, 12); *should = false; break; @@ -619,7 +622,7 @@ void BossRush_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* } // Skip past the "Save?" window when dying and go to the "Continue?" screen immediately. case VB_TRANSITION_TO_SAVE_SCREEN_ON_DEATH: { - PauseContext* pauseCtx = static_cast(optionalArg); + PauseContext* pauseCtx = va_arg(args, PauseContext*); pauseCtx->state = 0xF; *should = false; break; @@ -640,6 +643,8 @@ void BossRush_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* break; } } + + va_end(args); } void BossRush_OnActorInitHandler(void* actorRef) { @@ -708,4 +713,4 @@ void BossRush_RegisterHooks() { onBossDefeatHook = GameInteractor::Instance->RegisterGameHook(BossRush_OnBossDefeatHandler); onActorUpdate = GameInteractor::Instance->RegisterGameHookForID(ACTOR_DOOR_WARP1, BossRush_OnBlueWarpUpdate); }); -} \ No newline at end of file +} diff --git a/soh/soh/Enhancements/cheat_hook_handlers.cpp b/soh/soh/Enhancements/cheat_hook_handlers.cpp index a5a1a0d5a..ef69d6174 100644 --- a/soh/soh/Enhancements/cheat_hook_handlers.cpp +++ b/soh/soh/Enhancements/cheat_hook_handlers.cpp @@ -12,7 +12,7 @@ extern SaveContext gSaveContext; extern PlayState* gPlayState; } -void CheatsOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* opt) { +void CheatsOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_list originalArgs) { switch (id) { case VB_DEKU_STICK_BREAK: { if (CVarGetInteger(CVAR_CHEAT("DekuStickCheat"), DEKU_STICK_NORMAL) != DEKU_STICK_NORMAL) { diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index 57fc9cf35..5e30441db 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -511,6 +511,7 @@ void GameInteractor_SetTriforceHuntCreditsWarpActive(uint8_t state); #ifdef __cplusplus +#include #include #include #include @@ -565,8 +566,14 @@ struct HookInfo { #define GET_CURRENT_REGISTERING_INFO(type) HookRegisteringInfo{} #endif -#define REGISTER_VB_SHOULD(flag, body) \ - GameInteractor::Instance->RegisterGameHookForID(flag, [](GIVanillaBehavior _, bool* should, void* opt) body) +#define REGISTER_VB_SHOULD(flag, body) \ + GameInteractor::Instance->RegisterGameHookForID( \ + flag, [](GIVanillaBehavior _, bool* should, va_list _originalArgs) { \ + va_list args; \ + va_copy(args, _originalArgs); \ + body; \ + va_end(args); \ + }) class GameInteractor { public: diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h b/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h index 5669da661..46f306a3c 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h @@ -28,7 +28,7 @@ DEFINE_HOOK(OnBossDefeat, (void* actor)); DEFINE_HOOK(OnPlayerBonk, ()); DEFINE_HOOK(OnPlayDestroy, ()); DEFINE_HOOK(OnPlayDrawEnd, ()); -DEFINE_HOOK(OnVanillaBehavior, (GIVanillaBehavior flag, bool* result, void* opt)); +DEFINE_HOOK(OnVanillaBehavior, (GIVanillaBehavior flag, bool* result, va_list originalArgs)); DEFINE_HOOK(OnSaveFile, (int32_t fileNum)); DEFINE_HOOK(OnLoadFile, (int32_t fileNum)); DEFINE_HOOK(OnDeleteFile, (int32_t fileNum)); @@ -55,4 +55,4 @@ DEFINE_HOOK(OnUpdateFileNameSelection, (int16_t charCode)); DEFINE_HOOK(OnSetGameLanguage, ()); DEFINE_HOOK(OnFileDropped, (std::string filePath)); DEFINE_HOOK(OnAssetAltChange, ()); -DEFINE_HOOK(OnKaleidoUpdate, ()); \ No newline at end of file +DEFINE_HOOK(OnKaleidoUpdate, ()); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp index 49724b66c..24efb40c1 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp @@ -119,14 +119,25 @@ void GameInteractor_ExecuteOnPlayDrawEnd() { GameInteractor::Instance->ExecuteHooks(); } -bool GameInteractor_Should(GIVanillaBehavior flag, bool result, void* opt) { - GameInteractor::Instance->ExecuteHooks(flag, &result, opt); - GameInteractor::Instance->ExecuteHooksForID(flag, flag, &result, opt); - if (opt != nullptr) { - GameInteractor::Instance->ExecuteHooksForPtr((uintptr_t)opt, flag, &result, opt); - } - GameInteractor::Instance->ExecuteHooksForFilter(flag, &result, opt); - return result; +bool GameInteractor_Should(GIVanillaBehavior flag, u32 result, ...) { + // Only the external function can use the Variadic Function syntax + // To pass the va args to the next caller must be done using va_list and reading the args into it + // Because there can be N subscribers registered to each template call, the subscribers will be responsible for + // creating a copy of this va_list to avoid incrementing the original pointer between calls + va_list args; + va_start(args, result); + + // Because of default argument promotion, even though our incoming "result" is just a bool, it needs to be typed as + // an int to be permitted to be used in `va_start`, otherwise it is undefined behavior. + // Here we downcast back to a bool for our actual hook handlers + bool boolResult = static_cast(result); + + GameInteractor::Instance->ExecuteHooks(flag, &boolResult, args); + GameInteractor::Instance->ExecuteHooksForID(flag, flag, &boolResult, args); + GameInteractor::Instance->ExecuteHooksForFilter(flag, &boolResult, args); + + va_end(args); + return boolResult; } // MARK: - Save Files diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h index e1cba237d..dccc9930a 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h @@ -1,4 +1,5 @@ #include "GameInteractor.h" +#include #ifdef __cplusplus extern "C" { @@ -28,7 +29,7 @@ void GameInteractor_ExecuteOnOcarinaSongAction(); void GameInteractor_ExecuteOnShopSlotChangeHooks(uint8_t cursorIndex, int16_t price); void GameInteractor_ExecuteOnPlayDestroy(); void GameInteractor_ExecuteOnPlayDrawEnd(); -bool GameInteractor_Should(GIVanillaBehavior flag, bool result, void* opt); +bool GameInteractor_Should(GIVanillaBehavior flag, uint32_t result, ...); // MARK: - Save Files void GameInteractor_ExecuteOnSaveFile(int32_t fileNum); diff --git a/soh/soh/Enhancements/randomizer/fishsanity.cpp b/soh/soh/Enhancements/randomizer/fishsanity.cpp index b69cec82b..5fa2974ae 100644 --- a/soh/soh/Enhancements/randomizer/fishsanity.cpp +++ b/soh/soh/Enhancements/randomizer/fishsanity.cpp @@ -465,10 +465,15 @@ namespace Rando { } } - void Fishsanity::OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* refActor) { - Actor* actor = static_cast(refActor); + void Fishsanity::OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_list originalArgs) { + va_list args; + va_copy(args, originalArgs); + + Actor* actor = va_arg(args, Actor*); auto fs = OTRGlobals::Instance->gRandoContext->GetFishsanity(); + va_end(args); + if (id == VB_BOTTLE_ACTOR && actor->id == ACTOR_EN_FISH && fs->GetOverworldFishShuffled()) { FishIdentity fish = OTRGlobals::Instance->gRandomizer->IdentifyFish(gPlayState->sceneNum, actor->params); if (fish.randomizerCheck != RC_UNKNOWN_CHECK && !Flags_GetRandomizerInf(fish.randomizerInf)) { @@ -577,4 +582,4 @@ extern "C" { gSPGrayscale(POLY_OPA_DISP++, false); CLOSE_DISPS(play->state.gfxCtx); } -} \ No newline at end of file +} diff --git a/soh/soh/Enhancements/randomizer/fishsanity.h b/soh/soh/Enhancements/randomizer/fishsanity.h index a8a8291f0..c98e9ab9c 100644 --- a/soh/soh/Enhancements/randomizer/fishsanity.h +++ b/soh/soh/Enhancements/randomizer/fishsanity.h @@ -156,7 +156,7 @@ class Fishsanity { /** * @brief VB hook handler for fishsanity */ - static void OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* refActor); + static void OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_list originalArgs); private: /** @@ -226,4 +226,4 @@ void Fishsanity_CloseGreyscaleColor(PlayState* play); } #endif -#endif // FISHSANITY_H \ No newline at end of file +#endif // FISHSANITY_H diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index c71f1965c..b03b5a3c8 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -608,7 +608,6 @@ void func_8083A434_override(PlayState* play, Player* player) { player->stateFlags1 |= PLAYER_STATE1_GETTING_ITEM | PLAYER_STATE1_IN_CUTSCENE; } - bool ShouldGiveFishingPrize(f32 sFishOnHandLength){ // RANDOTODO: update the enhancement sliders to not allow // values above rando fish weight values when rando'd @@ -624,7 +623,10 @@ bool ShouldGiveFishingPrize(f32 sFishOnHandLength){ } } -void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* optionalArg) { +void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_list originalArgs) { + va_list args; + va_copy(args, originalArgs); + switch (id) { case VB_PLAY_SLOW_CHEST_CS: { // We force fast chests if SkipGetItemAnimation is enabled because the camera in the CS looks pretty wonky otherwise @@ -634,7 +636,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_GIVE_ITEM_FROM_CHEST: { - EnBox* chest = static_cast(optionalArg); + EnBox* chest = va_arg(args, EnBox*); RandomizerCheck rc = OTRGlobals::Instance->gRandomizer->GetCheckFromActor(chest->dyna.actor.id, gPlayState->sceneNum, chest->dyna.actor.params); // if this is a treasure chest game chest then set the appropriate rando inf @@ -717,7 +719,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void } break; case VB_ITEM00_DESPAWN: { - EnItem00* item00 = static_cast(optionalArg); + EnItem00* item00 = va_arg(args, EnItem00*); if (item00->actor.params == ITEM00_HEART_PIECE || item00->actor.params == ITEM00_SMALL_KEY) { RandomizerCheck rc = OTRGlobals::Instance->gRandomizer->GetCheckFromActor(item00->actor.id, gPlayState->sceneNum, item00->ogParams); if (rc != RC_UNKNOWN_CHECK) { @@ -734,7 +736,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_ITEM_B_HEART_DESPAWN: { - ItemBHeart* itemBHeart = static_cast(optionalArg); + ItemBHeart* itemBHeart = va_arg(args, ItemBHeart*); RandomizerCheck rc = OTRGlobals::Instance->gRandomizer->GetCheckFromActor(itemBHeart->actor.id, gPlayState->sceneNum, itemBHeart->actor.params); if (rc != RC_UNKNOWN_CHECK) { itemBHeart->sohItemEntry = Rando::Context::GetInstance()->GetFinalGIEntry(rc, true, (GetItemID)Rando::StaticData::GetLocation(rc)->GetVanillaItem()); @@ -749,7 +751,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_SET_CUCCO_COUNT: { - EnNiwLady* enNiwLady = static_cast(optionalArg); + EnNiwLady* enNiwLady = va_arg(args, EnNiwLady*); // Override starting Cucco count using setting value enNiwLady->cuccosInPen = 7 - RAND_GET_OPTION(RSK_CUCCO_COUNT); *should = false; @@ -811,7 +813,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_GIVE_ITEM_FROM_ITEM_00: { - EnItem00* item00 = static_cast(optionalArg); + EnItem00* item00 = va_arg(args, EnItem00*); if (item00->actor.params == ITEM00_SOH_DUMMY) { if (item00->randoInf != RAND_INF_MAX) { Flags_SetRandomizerInf(item00->randoInf); @@ -856,7 +858,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void if (!RAND_GET_OPTION(RSK_SHUFFLE_COWS)) { break; } - EnCow* enCow = static_cast(optionalArg); + EnCow* enCow = va_arg(args, EnCow*); CowIdentity cowIdentity = OTRGlobals::Instance->gRandomizer->IdentifyCow(gPlayState->sceneNum, enCow->actor.world.pos.x, enCow->actor.world.pos.z); // Has this cow already rewarded an item? if (Flags_GetRandomizerInf(cowIdentity.randomizerInf)) { @@ -873,7 +875,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void if (!EnDs_RandoCanGetGrannyItem()) { break; } - EnDs* granny = static_cast(optionalArg); + EnDs* granny = va_arg(args, EnDs*); // Only setting the inf if we've actually gotten the rando item and not the vanilla blue potion Flags_SetRandomizerInf(RAND_INF_MERCHANTS_GRANNYS_SHOP); granny->actor.parent = NULL; @@ -882,7 +884,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_GIVE_ITEM_FROM_THAWING_KING_ZORA: { - EnKz* enKz = static_cast(optionalArg); + EnKz* enKz = va_arg(args, EnKz*); // If we aren't setting up the item offer, then we're just checking if it should be possible. if (enKz->actionFunc != (EnKzActionFunc)EnKz_SetupGetItem) { // Always give the reward in rando @@ -909,7 +911,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_GIVE_ITEM_FROM_CARPET_SALESMAN: { - EnJs* enJs = static_cast(optionalArg); + EnJs* enJs = va_arg(args, EnJs*); if (EnJs_RandoCanGetCarpetMerchantItem()){ Rupees_ChangeBy(OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_WASTELAND_BOMBCHU_SALESMAN)->GetPrice() * -1); enJs->actor.parent = NULL; @@ -937,7 +939,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void case VB_BE_ELIGIBLE_FOR_GIANTS_KNIFE_PURCHASE: if (EnGm_RandoCanGetMedigoronItem()) { if (id == VB_GIVE_ITEM_FROM_MEDIGORON) { - EnGm* enGm = static_cast(optionalArg); + EnGm* enGm = va_arg(args, EnGm*); Flags_SetInfTable(INFTABLE_B1); Flags_SetRandomizerInf(RAND_INF_MERCHANTS_MEDIGORON); enGm->actor.parent = NULL; @@ -953,7 +955,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_GIVE_ITEM_FROM_MAGIC_BEAN_SALESMAN: { - EnMs* enMs = static_cast(optionalArg); + EnMs* enMs = va_arg(args, EnMs*); if (RAND_GET_OPTION(RSK_SHUFFLE_MERCHANTS) == RO_SHUFFLE_MERCHANTS_BEANS_ONLY || RAND_GET_OPTION(RSK_SHUFFLE_MERCHANTS) == RO_SHUFFLE_MERCHANTS_ALL) { Rupees_ChangeBy(OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_ZR_MAGIC_BEAN_SALESMAN)->GetPrice() * -1); @@ -966,7 +968,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_GIVE_ITEM_FROM_FROGS: { - EnFr* enFr = static_cast(optionalArg); + EnFr* enFr = va_arg(args, EnFr*); // Skip GiveReward+SetIdle action func if the reward is an ice trap if (enFr->actionFunc == (EnFrActionFunc)EnFr_GiveReward) { @@ -993,7 +995,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_TRADE_ODD_MUSHROOM: { - EnDs* granny = static_cast(optionalArg); + EnDs* granny = va_arg(args, EnDs*); Randomizer_ConsumeAdultTradeItem(gPlayState, ITEM_ODD_MUSHROOM); // Trigger the reward now Flags_SetItemGetInf(ITEMGETINF_30); @@ -1004,7 +1006,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_TRADE_ODD_POTION: { - EnKo* enKo = static_cast(optionalArg); + EnKo* enKo = va_arg(args, EnKo*); Randomizer_ConsumeAdultTradeItem(gPlayState, ITEM_ODD_POTION); // Trigger the reward now Flags_SetItemGetInf(ITEMGETINF_31); @@ -1017,7 +1019,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_TRADE_PRESCRIPTION: { - EnKz* enKz = static_cast(optionalArg); + EnKz* enKz = va_arg(args, EnKz*); // If we aren't setting up the item offer, then we're just checking if it should be possible. if (enKz->actionFunc != (EnKzActionFunc)EnKz_SetupGetItem) { *should = !Flags_GetRandomizerInf(RAND_INF_ADULT_TRADES_ZD_TRADE_PRESCRIPTION); @@ -1036,13 +1038,13 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void if (!RAND_GET_OPTION(RSK_SHUFFLE_COWS)) { break; } - EnCow* enCow = static_cast(optionalArg); + EnCow* enCow = va_arg(args, EnCow*); // If this is a cow we have to move, then move it now. EnCow_MoveForRandomizer(enCow, gPlayState); break; } case VB_BUSINESS_SCRUB_DESPAWN: { - EnShopnuts* enShopnuts = static_cast(optionalArg); + EnShopnuts* enShopnuts = va_arg(args, EnShopnuts*); s16 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data & ((1 << 8) - 1); ScrubIdentity scrubIdentity = OTRGlobals::Instance->gRandomizer->IdentifyScrub(gPlayState->sceneNum, enShopnuts->actor.params, respawnData); @@ -1052,7 +1054,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_GIVE_ITEM_FROM_BUSINESS_SCRUB: { - EnDns* enDns = static_cast(optionalArg); + EnDns* enDns = va_arg(args, EnDns*); *should = !enDns->sohScrubIdentity.isShuffled; break; } @@ -1089,7 +1091,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void } case VB_USE_EYEDROP_DIALOGUE: { // Skip eye drop text on rando if Link went in the water, so you can still receive the dive check - EnMk* enMk = static_cast(optionalArg); + EnMk* enMk = va_arg(args, EnMk*); *should &= enMk->swimFlag == 0; break; } @@ -1117,7 +1119,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_GIVE_ITEM_FROM_SHOOTING_GALLERY: { - EnSyatekiMan* enSyatekiMan = static_cast(optionalArg); + EnSyatekiMan* enSyatekiMan = va_arg(args, EnSyatekiMan*); enSyatekiMan->getItemId = GI_RUPEE_PURPLE; if (LINK_IS_ADULT) { // Give purple rupee if we've already obtained the reward OR we don't have a bow @@ -1159,7 +1161,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void // in that array is GI_RUPEE_GOLD, and the reward is picked in EnSth_GivePlayerItem // via sGetItemIds[this->actor.params]. This means if actor.params == 0 we're looking // at the 100 GS reward - EnSth* enSth = static_cast(optionalArg); + EnSth* enSth = va_arg(args, EnSth*); if (enSth->actor.params == 0) { // if nothing is shuffled onto 100 GS, // or we already got the 100 GS reward, @@ -1182,14 +1184,14 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_GIVE_ITEM_FROM_OCARINA_MEMORY_GAME: { - EnSkj* enSkj = static_cast(optionalArg); + EnSkj* enSkj = va_arg(args, EnSkj*); Flags_SetItemGetInf(ITEMGETINF_17); enSkj->actionFunc = (EnSkjActionFunc)EnSkj_CleanupOcarinaGame; *should = false; break; } case VB_GIVE_ITEM_FROM_LOST_DOG: { - EnHy* enHy = static_cast(optionalArg); + EnHy* enHy = va_arg(args, EnHy*); Flags_SetInfTable(INFTABLE_191); gSaveContext.dogParams = 0; gSaveContext.dogIsLost = false; @@ -1198,7 +1200,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_GIVE_ITEM_FROM_BOMBCHU_BOWLING: { - EnBomBowlPit* enBomBowlPit = static_cast(optionalArg); + EnBomBowlPit* enBomBowlPit = va_arg(args, EnBomBowlPit*); if (enBomBowlPit->prizeIndex == EXITEM_BOMB_BAG_BOWLING || enBomBowlPit->prizeIndex == EXITEM_HEART_PIECE_BOWLING) { *should = false; } @@ -1233,7 +1235,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_DRAW_AMMO_COUNT: { - s16 item = *static_cast(optionalArg); + s16 item = *va_arg(args, s16*); // don't draw ammo count if you have the infinite upgrade if ( (item == ITEM_NUT && Flags_GetRandomizerInf(RAND_INF_HAS_INFINITE_NUT_UPGRADE)) || @@ -1283,7 +1285,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void case VB_SKIP_SCARECROWS_SONG: { int ocarinaButtonCount = 0; for (int i = VB_HAVE_OCARINA_NOTE_D4; i <= VB_HAVE_OCARINA_NOTE_A4; i++) { - if (GameInteractor_Should((GIVanillaBehavior)i, true, NULL)) { + if (GameInteractor_Should((GIVanillaBehavior)i, true)) { ocarinaButtonCount++; } } @@ -1324,12 +1326,12 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_SHOULD_CHECK_FOR_FISHING_RECORD: { - f32 sFishOnHandLength = *static_cast(optionalArg); + f32 sFishOnHandLength = *va_arg(args, f32*); *should = *should || ShouldGiveFishingPrize(sFishOnHandLength); break; } case VB_SHOULD_SET_FISHING_RECORD: { - VBFishingData* fishData = static_cast(optionalArg); + VBFishingData* fishData = va_arg(args, VBFishingData*); *should = (s16)fishData->sFishingRecordLength < (s16)fishData->fishWeight; if (!*should){ *fishData->sFishOnHandLength = 0.0f; @@ -1337,13 +1339,13 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void break; } case VB_SHOULD_GIVE_VANILLA_FISHING_PRIZE: { - VBFishingData* fishData = static_cast(optionalArg); + VBFishingData* fishData = va_arg(args, VBFishingData*); *should = !IS_RANDO && ShouldGiveFishingPrize(fishData->fishWeight); break; } case VB_GIVE_RANDO_FISHING_PRIZE: { if (IS_RANDO){ - VBFishingData* fishData = static_cast(optionalArg); + VBFishingData* fishData = va_arg(args, VBFishingData*); if (*fishData->sFishOnHandIsLoach) { if (!Flags_GetRandomizerInf(RAND_INF_CAUGHT_LOACH) && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_FISHSANITY) == RO_FISHSANITY_HYRULE_LOACH){ @@ -1402,6 +1404,8 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void default: break; } + + va_end(args); } void RandomizerOnSceneInitHandler(int16_t sceneNum) { @@ -1459,7 +1463,7 @@ void RandomizerOnSceneInitHandler(int16_t sceneNum) { } // 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)) { + if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_LIGHT_ARROWS, false)) { Flags_SetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS); } diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index ec56b95cc..bc6eb9ca5 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -107,7 +107,10 @@ void TimeSaverOnGameFrameUpdateHandler() { } } -void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* opt) { +void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_list originalArgs) { + va_list args; + va_copy(args, originalArgs); + switch (id) { case VB_PLAY_TRANSITION_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO) { @@ -124,7 +127,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* Flags_SetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT); // Normally happens in the cutscene gSaveContext.dayTime = gSaveContext.skyboxTime = 0xAC60; - if (GameInteractor_Should(VB_GIVE_ITEM_REQUIEM_OF_SPIRIT, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_REQUIEM_OF_SPIRIT, true)) { Item_Give(gPlayState, ITEM_SONG_REQUIEM); } *should = false; @@ -137,11 +140,11 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP) && !Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL); - if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_NOCTURNE_OF_SHADOW, meetsBurningKakRequirements, NULL)) { + if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_NOCTURNE_OF_SHADOW, meetsBurningKakRequirements)) { Flags_SetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL); // Normally happens in the cutscene Flags_SetEventChkInf(EVENTCHKINF_LEARNED_NOCTURNE_OF_SHADOW); - if (GameInteractor_Should(VB_GIVE_ITEM_NOCTURNE_OF_SHADOW, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_NOCTURNE_OF_SHADOW, true)) { Item_Give(gPlayState, ITEM_SONG_NOCTURNE); } *should = false; @@ -156,9 +159,9 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) && !Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS); - if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_LIGHT_ARROWS, meetsLACSRequirements, NULL)) { + if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_LIGHT_ARROWS, meetsLACSRequirements)) { Flags_SetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS); - if (GameInteractor_Should(VB_GIVE_ITEM_LIGHT_ARROW, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_LIGHT_ARROW, true)) { Item_Give(gPlayState, ITEM_ARROW_LIGHT); } *should = false; @@ -182,7 +185,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* break; } case VB_PLAY_ENTRANCE_CS: { - s32* entranceFlag = static_cast(opt); + s32* entranceFlag = va_arg(args, s32*); if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Entrances"), IS_RANDO) && (*entranceFlag != EVENTCHKINF_EPONA_OBTAINED)) { *should = false; } @@ -190,7 +193,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* } case VB_PLAY_ONEPOINT_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.OnePoint"), IS_RANDO)) { - s16* csId = static_cast(opt); + s16* csId = va_arg(args, s16*); switch (*csId) { case 4180: case 4100: @@ -206,7 +209,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* } case VB_PLAY_ONEPOINT_ACTOR_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.OnePoint"), IS_RANDO)) { - Actor* actor = static_cast(opt); + Actor* actor = va_arg(args, Actor*); // there are a few checks throughout the game (such as chest spawns) that rely on this // the checks are for func_8005B198() == this->dyna.actor.category @@ -217,7 +220,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* switch (actor->category) { case ACTORCAT_BG: if (actor->id == ACTOR_BG_DDAN_KD) { - BgDdanKd* ddanKd = static_cast(opt); + BgDdanKd* ddanKd = (BgDdanKd*)actor; Flags_SetSwitch(gPlayState, ddanKd->dyna.actor.params); } if (actor->id == ACTOR_BG_MORI_HINERI) { @@ -234,7 +237,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* } switch (actor->id) { case ACTOR_OBJ_SWITCH: { - ObjSwitch *switchActor = static_cast(opt); + ObjSwitch *switchActor = (ObjSwitch*)actor; switchActor->cooldownTimer = 0; *should = false; RateLimitedSuccessChime(); @@ -247,7 +250,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* if (actor->params == 14848 && gPlayState->sceneNum == SCENE_JABU_JABU && !CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.GlitchAiding"), 0)){ break; } - BgBdanSwitch* switchActor = static_cast(opt); + BgBdanSwitch* switchActor = (BgBdanSwitch*)actor; switchActor->unk_1D8 = 0; switchActor->unk_1DA = 0; *should = false; @@ -255,7 +258,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* break; } case ACTOR_BG_HIDAN_KOUSI: { - BgHidanKousi* switchActor = static_cast(opt); + BgHidanKousi* switchActor = (BgHidanKousi*)actor; BgHidanKousi_SetupAction(switchActor, func_80889C18); *should = false; RateLimitedSuccessChime(); @@ -316,7 +319,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* } case VB_NAVI_TALK: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.NoForcedDialog"), IS_RANDO)) { - ElfMsg* naviTalk = static_cast(opt); + ElfMsg* naviTalk = va_arg(args, ElfMsg*); if (((naviTalk->actor.params >> 8) & 0x3F) != 0x3F) { Flags_SetSwitch(gPlayState, (naviTalk->actor.params >> 8) & 0x3F); Actor_Kill(&naviTalk->actor); @@ -351,7 +354,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* Flags_SetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER); Flags_SetEventChkInf(EVENTCHKINF_SHEIK_SPAWNED_AT_MASTER_SWORD_PEDESTAL); Flags_SetEventChkInf(EVENTCHKINF_TIME_TRAVELED_TO_ADULT); - if (GameInteractor_Should(VB_GIVE_ITEM_LIGHT_MEDALLION, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_LIGHT_MEDALLION, true)) { Item_Give(gPlayState, ITEM_MEDALLION_LIGHT); } } @@ -360,7 +363,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* break; case VB_OWL_INTERACTION: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipOwlInteractions"), IS_RANDO) && *should) { - EnOwl* enOwl = static_cast(opt); + EnOwl* enOwl = va_arg(args, EnOwl*); s32 owlType = (enOwl->actor.params & 0xFC0) >> 6; if (((enOwl->actor.params & 0xFC0) >> 6) == 1) { @@ -374,7 +377,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* } case VB_OVERRIDE_LINK_THE_GORON_DIALOGUE: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO)) { - u16* textId = static_cast(opt); + u16* textId = va_arg(args, u16*); // If the doors are not open yet, prioritize opening them if (!Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED)) { *textId = 0x3036; @@ -393,7 +396,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* break; case VB_PLAY_ZELDAS_LULLABY_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO) { - DemoIm* demoIm = static_cast(opt); + DemoIm* demoIm = va_arg(args, DemoIm*); Player* player = GET_PLAYER(gPlayState); player->stateFlags1 |= PLAYER_STATE1_IN_CUTSCENE; player->stateFlags1 |= PLAYER_STATE1_GETTING_ITEM; @@ -443,7 +446,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* } case VB_PLAY_SARIAS_SONG_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO) { - EnSa* enSa = static_cast(opt); + EnSa* enSa = va_arg(args, EnSa*); enSa->actionFunc = func_80AF6B20; *should = false; } @@ -520,14 +523,14 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* break; case VB_BE_VALID_GRAVEDIGGING_SPOT: if (CVarGetInteger(CVAR_ENHANCEMENT("DampeWin"), 0)) { - EnTk *enTk = static_cast(opt); + EnTk *enTk = va_arg(args, EnTk*); enTk->validDigHere = true; *should = true; } break; case VB_BE_DAMPE_GRAVEDIGGING_GRAND_PRIZE: if (CVarGetInteger(CVAR_ENHANCEMENT("DampeWin"), 0)) { - EnTk *enTk = static_cast(opt); + EnTk *enTk = va_arg(args, EnTk*); enTk->currentReward = 3; *should = true; } @@ -546,7 +549,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* *should = Environment_GetBgsDayCount() >= CVarGetInteger(CVAR_ENHANCEMENT("ForgeTime"), 3); break; case VB_BE_ELIGIBLE_FOR_GREAT_FAIRY_REWARD: { - BgDyYoseizo* bgDyYoseizo = static_cast(opt); + BgDyYoseizo* bgDyYoseizo = va_arg(args, BgDyYoseizo*); RandomizerInf flag = RAND_INF_MAX; if (gPlayState->sceneNum == SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS) { @@ -596,7 +599,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* case VB_PHANTOM_GANON_DEATH_SCENE: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.QuickBossDeaths"), IS_RANDO || IS_BOSS_RUSH)) { *should = false; - BossGanondrof* pg = static_cast(opt); + BossGanondrof* pg = va_arg(args, BossGanondrof*); Player* player = GET_PLAYER(gPlayState); if (pg != nullptr && pg->work[GND_ACTION_STATE] == DEATH_SPASM) { // Skip to death scream animation and move ganondrof to middle @@ -619,7 +622,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* break; } case VB_NABOORU_KNUCKLE_DEATH_SCENE: { - EnIk* ik = static_cast(opt); + EnIk* ik = va_arg(args, EnIk*); if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.QuickBossDeaths"), IS_RANDO)) { // Because no CS in rando, we hide the death of the knuckle by spawning flames and kill the actor if ((ik->actor.colChkInfo.health <= 10)) { @@ -645,7 +648,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* if (CVarGetInteger(CVAR_ENHANCEMENT("FastChests"), 0)) { *should = false; } else if (CVarGetInteger(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), CSMC_DISABLED) && *should) { - EnBox* enBox = static_cast(opt); + EnBox* enBox = va_arg(args, EnBox*); *should = enBox->dyna.actor.scale.x != 0.005f; } break; @@ -657,6 +660,8 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* break; } } + + va_end(args); } static uint32_t enMa1UpdateHook = 0; @@ -795,7 +800,7 @@ void TimeSaverOnSceneInitHandler(int16_t sceneNum) { } break; case SCENE_LON_LON_RANCH: - if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO) && GameInteractor_Should(VB_MALON_RETURN_FROM_CASTLE, Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE), NULL)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO) && GameInteractor_Should(VB_MALON_RETURN_FROM_CASTLE, Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE))) { Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_RANCH); Flags_SetInfTable(INFTABLE_CHILD_MALON_SAID_EPONA_WAS_AFRAID_OF_YOU); Flags_SetEventChkInf(EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON); diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index 145ab7c1c..76fe3e6a7 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -1628,23 +1628,23 @@ void func_800ED458(s32 arg0) { } Audio_OcaUpdateBtnMap(customControls, dpad, rStick); - if (D_8016BA18 & sOcarinaD4BtnMap && GameInteractor_Should(VB_HAVE_OCARINA_NOTE_D4, true, NULL)) { + if (D_8016BA18 & sOcarinaD4BtnMap && GameInteractor_Should(VB_HAVE_OCARINA_NOTE_D4, true)) { osSyncPrintf("Presss NA_KEY_D4 %08x\n", sOcarinaD4BtnMap); sCurOcarinaBtnVal = 2; sCurOcarinaBtnIdx = 0; - } else if (D_8016BA18 & sOcarinaF4BtnMap && GameInteractor_Should(VB_HAVE_OCARINA_NOTE_F4, true, NULL)) { + } else if (D_8016BA18 & sOcarinaF4BtnMap && GameInteractor_Should(VB_HAVE_OCARINA_NOTE_F4, true)) { osSyncPrintf("Presss NA_KEY_F4 %08x\n", sOcarinaF4BtnMap); sCurOcarinaBtnVal = 5; sCurOcarinaBtnIdx = 1; - } else if (D_8016BA18 & sOcarinaA4BtnMap && GameInteractor_Should(VB_HAVE_OCARINA_NOTE_A4, true, NULL)) { + } else if (D_8016BA18 & sOcarinaA4BtnMap && GameInteractor_Should(VB_HAVE_OCARINA_NOTE_A4, true)) { osSyncPrintf("Presss NA_KEY_A4 %08x\n", sOcarinaA4BtnMap); sCurOcarinaBtnVal = 9; sCurOcarinaBtnIdx = 2; - } else if (D_8016BA18 & sOcarinaB4BtnMap && GameInteractor_Should(VB_HAVE_OCARINA_NOTE_B4, true, NULL)) { + } else if (D_8016BA18 & sOcarinaB4BtnMap && GameInteractor_Should(VB_HAVE_OCARINA_NOTE_B4, true)) { osSyncPrintf("Presss NA_KEY_B4 %08x\n", sOcarinaA4BtnMap); sCurOcarinaBtnVal = 0xB; sCurOcarinaBtnIdx = 3; - } else if (D_8016BA18 & sOcarinaD5BtnMap && GameInteractor_Should(VB_HAVE_OCARINA_NOTE_D5, true, NULL)) { + } else if (D_8016BA18 & sOcarinaD5BtnMap && GameInteractor_Should(VB_HAVE_OCARINA_NOTE_D5, true)) { osSyncPrintf("Presss NA_KEY_D5 %08x\n", sOcarinaD5BtnMap); sCurOcarinaBtnVal = 0xE; sCurOcarinaBtnIdx = 4; diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index 424fca83f..499e16898 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -497,11 +497,11 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB bool shouldSkipCommand = false; - if (cmd->base == 8 && !GameInteractor_Should(VB_PLAY_PULL_MASTER_SWORD_CS, true, NULL)) { + if (cmd->base == 8 && !GameInteractor_Should(VB_PLAY_PULL_MASTER_SWORD_CS, true)) { shouldSkipCommand = true; } - if (cmd->base == 24 && !GameInteractor_Should(VB_PLAY_DROP_FISH_FOR_JABU_CS, true, NULL)) { + if (cmd->base == 24 && !GameInteractor_Should(VB_PLAY_DROP_FISH_FOR_JABU_CS, true)) { shouldSkipCommand = true; } @@ -631,7 +631,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB gSaveContext.fw.set = 0; gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0; } - if (GameInteractor_Should(VB_PLAY_PULL_MASTER_SWORD_CS, !Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL), NULL)) { + if (GameInteractor_Should(VB_PLAY_PULL_MASTER_SWORD_CS, !Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL))) { Flags_SetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL); play->nextEntranceIndex = ENTR_CUTSCENE_MAP_0; play->transitionTrigger = TRANS_TRIGGER_START; @@ -723,7 +723,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->transitionType = TRANS_TYPE_FADE_WHITE; break; case 22: - if (GameInteractor_Should(VB_GIVE_ITEM_REQUIEM_OF_SPIRIT, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_REQUIEM_OF_SPIRIT, true)) { Item_Give(play, ITEM_SONG_REQUIEM); } play->nextEntranceIndex = ENTR_DESERT_COLOSSUS_0; @@ -777,7 +777,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->nextEntranceIndex = ENTR_CHAMBER_OF_THE_SAGES_0; play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_WHITE; - if (GameInteractor_Should(VB_GIVE_ITEM_FIRE_MEDALLION, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_FIRE_MEDALLION, true)) { Item_Give(play, ITEM_MEDALLION_FIRE); } gSaveContext.chamberCutsceneNum = 1; @@ -859,7 +859,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->transitionType = TRANS_TYPE_FADE_BLACK_FAST; break; case 47: - if (GameInteractor_Should(VB_GIVE_ITEM_NOCTURNE_OF_SHADOW, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_NOCTURNE_OF_SHADOW, true)) { Item_Give(play, ITEM_SONG_NOCTURNE); } Flags_SetEventChkInf(EVENTCHKINF_LEARNED_NOCTURNE_OF_SHADOW); @@ -2197,7 +2197,7 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) { osSyncPrintf("\ngame_info.mode=[%d] restart_flag", ((void)0, gSaveContext.respawnFlag)); LUSLOG_INFO("Cutscene_HandleConditionalTriggers - entranceIndex: %#x cutsceneIndex: %#x", gSaveContext.entranceIndex, gSaveContext.cutsceneIndex); - if (!GameInteractor_Should(VB_PLAY_TRANSITION_CS, true, NULL)) { + if (!GameInteractor_Should(VB_PLAY_TRANSITION_CS, true)) { return; } @@ -2213,12 +2213,12 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) { Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP) && !Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL) - ), NULL)) { + ))) { Flags_SetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL); gSaveContext.cutsceneIndex = 0xFFF0; } else if ((gSaveContext.entranceIndex == ENTR_LOST_WOODS_9) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE)) { Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE); - if (GameInteractor_Should(VB_GIVE_ITEM_FAIRY_OCARINA, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_FAIRY_OCARINA, true)) { Item_Give(play, ITEM_OCARINA_FAIRY); } gSaveContext.entranceIndex = ENTR_LOST_WOODS_0; @@ -2229,7 +2229,7 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) { LINK_IS_ADULT && !Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) && (gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TEMPLE_OF_TIME) - ), NULL)) { + ))) { Flags_SetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS); gSaveContext.entranceIndex = ENTR_TEMPLE_OF_TIME_0; gSaveContext.cutsceneIndex = 0xFFF8; diff --git a/soh/src/code/z_horse.c b/soh/src/code/z_horse.c index 33ba7a84d..de50eac4a 100644 --- a/soh/src/code/z_horse.c +++ b/soh/src/code/z_horse.c @@ -77,9 +77,9 @@ void func_8006D0EC(PlayState* play, Player* player) { } else if ((play->sceneNum == gSaveContext.horseData.scene) && (((Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) != 0) && (!IS_RANDO || (IS_RANDO && CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && - GameInteractor_Should(VB_HAVE_OCARINA_NOTE_D5, true, NULL) && - GameInteractor_Should(VB_HAVE_OCARINA_NOTE_B4, true, NULL) && - GameInteractor_Should(VB_HAVE_OCARINA_NOTE_A4, true, NULL) && + GameInteractor_Should(VB_HAVE_OCARINA_NOTE_D5, true) && + GameInteractor_Should(VB_HAVE_OCARINA_NOTE_B4, true) && + GameInteractor_Should(VB_HAVE_OCARINA_NOTE_A4, true) && (INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_NONE)))) || DREG(1) != 0)) { // "Set by existence of horse %d %d %d" osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene, Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED), diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 8da747dd5..4e1dc8692 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -2610,18 +2610,18 @@ void Message_DrawMain(PlayState* play, Gfx** p) { u8 songItemId = ITEM_SONG_MINUET + gOcarinaSongItemMap[msgCtx->ocarinaStaff->state]; if ( - (songItemId == ITEM_SONG_MINUET && GameInteractor_Should(VB_GIVE_ITEM_MINUET_OF_FOREST, true, NULL)) || - (songItemId == ITEM_SONG_BOLERO && GameInteractor_Should(VB_GIVE_ITEM_BOLERO_OF_FIRE, true, NULL)) || - (songItemId == ITEM_SONG_SERENADE && GameInteractor_Should(VB_GIVE_ITEM_SERENADE_OF_WATER, true, NULL)) || - (songItemId == ITEM_SONG_REQUIEM && GameInteractor_Should(VB_GIVE_ITEM_REQUIEM_OF_SPIRIT, true, NULL)) || - (songItemId == ITEM_SONG_NOCTURNE && GameInteractor_Should(VB_GIVE_ITEM_NOCTURNE_OF_SHADOW, true, NULL)) || - (songItemId == ITEM_SONG_PRELUDE && GameInteractor_Should(VB_GIVE_ITEM_PRELUDE_OF_LIGHT, true, NULL)) || - (songItemId == ITEM_SONG_LULLABY && GameInteractor_Should(VB_GIVE_ITEM_ZELDAS_LULLABY, true, NULL)) || - (songItemId == ITEM_SONG_EPONA && GameInteractor_Should(VB_GIVE_ITEM_EPONAS_SONG, true, NULL)) || - (songItemId == ITEM_SONG_SARIA && GameInteractor_Should(VB_GIVE_ITEM_SARIAS_SONG, true, NULL)) || - (songItemId == ITEM_SONG_SUN && GameInteractor_Should(VB_GIVE_ITEM_SUNS_SONG, true, NULL)) || - (songItemId == ITEM_SONG_TIME && GameInteractor_Should(VB_GIVE_ITEM_SONG_OF_TIME, true, NULL)) || - (songItemId == ITEM_SONG_STORMS && GameInteractor_Should(VB_GIVE_ITEM_SONG_OF_STORMS, true, NULL)) + (songItemId == ITEM_SONG_MINUET && GameInteractor_Should(VB_GIVE_ITEM_MINUET_OF_FOREST, true)) || + (songItemId == ITEM_SONG_BOLERO && GameInteractor_Should(VB_GIVE_ITEM_BOLERO_OF_FIRE, true)) || + (songItemId == ITEM_SONG_SERENADE && GameInteractor_Should(VB_GIVE_ITEM_SERENADE_OF_WATER, true)) || + (songItemId == ITEM_SONG_REQUIEM && GameInteractor_Should(VB_GIVE_ITEM_REQUIEM_OF_SPIRIT, true)) || + (songItemId == ITEM_SONG_NOCTURNE && GameInteractor_Should(VB_GIVE_ITEM_NOCTURNE_OF_SHADOW, true)) || + (songItemId == ITEM_SONG_PRELUDE && GameInteractor_Should(VB_GIVE_ITEM_PRELUDE_OF_LIGHT, true)) || + (songItemId == ITEM_SONG_LULLABY && GameInteractor_Should(VB_GIVE_ITEM_ZELDAS_LULLABY, true)) || + (songItemId == ITEM_SONG_EPONA && GameInteractor_Should(VB_GIVE_ITEM_EPONAS_SONG, true)) || + (songItemId == ITEM_SONG_SARIA && GameInteractor_Should(VB_GIVE_ITEM_SARIAS_SONG, true)) || + (songItemId == ITEM_SONG_SUN && GameInteractor_Should(VB_GIVE_ITEM_SUNS_SONG, true)) || + (songItemId == ITEM_SONG_TIME && GameInteractor_Should(VB_GIVE_ITEM_SONG_OF_TIME, true)) || + (songItemId == ITEM_SONG_STORMS && GameInteractor_Should(VB_GIVE_ITEM_SONG_OF_STORMS, true)) ) { Item_Give(play, songItemId); } diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 0d14468f2..0a2b91406 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -5372,7 +5372,7 @@ void Interface_Draw(PlayState* play) { if (fullUi) { s16 PosX_RC; s16 PosY_RC; - if (GameInteractor_Should(VB_RENDER_RUPEE_COUNTER, true, NULL)) { + if (GameInteractor_Should(VB_RENDER_RUPEE_COUNTER, true)) { // Rupee Icon if (CVarGetInteger(CVAR_ENHANCEMENT("DynamicWalletIcon"), 0)) { switch (CUR_UPG_VALUE(UPG_WALLET)) { @@ -5446,7 +5446,7 @@ void Interface_Draw(PlayState* play) { OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, PosX_RC, PosY_RC, 16, 16, 1 << 10, 1 << 10); } - if (GameInteractor_Should(VB_RENDER_KEY_COUNTER, true, NULL)) { + if (GameInteractor_Should(VB_RENDER_KEY_COUNTER, true)) { switch (play->sceneNum) { case SCENE_FOREST_TEMPLE: case SCENE_FIRE_TEMPLE: @@ -5527,7 +5527,7 @@ void Interface_Draw(PlayState* play) { } } - if (GameInteractor_Should(VB_RENDER_RUPEE_COUNTER, true, NULL)) { + if (GameInteractor_Should(VB_RENDER_RUPEE_COUNTER, true)) { // Rupee Counter gDPPipeSync(OVERLAY_DISP++); diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index 8a848f301..08ddef62d 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -200,7 +200,7 @@ void Sram_OpenSave() { } } - if (GameInteractor_Should(VB_REVERT_SPOILING_ITEMS, true, NULL)) { + if (GameInteractor_Should(VB_REVERT_SPOILING_ITEMS, true)) { for (i = 0; i < ARRAY_COUNT(gSpoilingItems); i++) { if (INV_CONTENT(ITEM_TRADE_ADULT) == gSpoilingItems[i]) { INV_CONTENT(gSpoilingItemReverts[i]) = gSpoilingItemReverts[i]; diff --git a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index c2db563b9..981f25cd2 100644 --- a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -276,7 +276,7 @@ void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { } } - if (GameInteractor_Should(VB_BG_BREAKWALL_BREAK, this->collider.base.acFlags & 2 || blueFireArrowHit, NULL)) { + if (GameInteractor_Should(VB_BG_BREAKWALL_BREAK, this->collider.base.acFlags & 2 || blueFireArrowHit)) { Vec3f effectPos; s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF; diff --git a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index afbe34053..18eae69fb 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -70,7 +70,7 @@ void func_808787A4(BgGjyoBridge* this, PlayState* play) { } void LaunchBridgeCutscene(BgGjyoBridge* this, PlayState* play) { - if (GameInteractor_Should(VB_PLAY_RAINBOW_BRIDGE_CS, true, NULL)) { + if (GameInteractor_Should(VB_PLAY_RAINBOW_BRIDGE_CS, true)) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gRainbowBridgeCs); gSaveContext.cutsceneTrigger = 1; } @@ -92,7 +92,7 @@ void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, PlayState* play) { (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) && CheckPlayerPosition(player, play); - if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_RAINBOW_BRIDGE, vanillaBridgeCondition, NULL)) { + if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_RAINBOW_BRIDGE, vanillaBridgeCondition)) { LaunchBridgeCutscene(this, play); } } @@ -103,7 +103,7 @@ void BgGjyoBridge_SpawnBridge(BgGjyoBridge* this, PlayState* play) { (play->csCtx.npcActions[2] != NULL) && (play->csCtx.npcActions[2]->action == 2); - if (!GameInteractor_Should(VB_PLAY_RAINBOW_BRIDGE_CS, true, NULL) || vanillaBridgeCondition) { + if (!GameInteractor_Should(VB_PLAY_RAINBOW_BRIDGE_CS, true) || vanillaBridgeCondition) { this->dyna.actor.draw = BgGjyoBridge_Draw; func_8003EC50(play, &play->colCtx.dyna, this->dyna.bgId); Flags_SetEventChkInf(EVENTCHKINF_RAINBOW_BRIDGE_BUILT); diff --git a/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 571123057..5d73c277f 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -61,7 +61,7 @@ void BgSpot12Saku_Init(Actor* thisx, PlayState* play) { func_808B3420(this, play, &gGerudoFortressGTGShutterCol, DPM_UNK); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (GameInteractor_Should(VB_GTG_GATE_BE_OPEN, Flags_GetSwitch(play, this->dyna.actor.params & 0x3F), NULL)) { + if (GameInteractor_Should(VB_GTG_GATE_BE_OPEN, Flags_GetSwitch(play, this->dyna.actor.params & 0x3F))) { func_808B3714(this); } else { func_808B3550(this); @@ -82,7 +82,7 @@ void func_808B3550(BgSpot12Saku* this) { } void func_808B357C(BgSpot12Saku* this, PlayState* play) { - if (GameInteractor_Should(VB_GTG_GATE_BE_OPEN, Flags_GetSwitch(play, this->dyna.actor.params & 0x3F), NULL)) { + if (GameInteractor_Should(VB_GTG_GATE_BE_OPEN, Flags_GetSwitch(play, this->dyna.actor.params & 0x3F))) { func_808B35E4(this); this->timer = 20; OnePointCutscene_Init(play, 4170, -99, &this->dyna.actor, MAIN_CAM); diff --git a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 0d1c234b5..621ed0e7f 100644 --- a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -126,7 +126,7 @@ void func_808BAF40(BgTokiSwd* this, PlayState* play) { if (!LINK_IS_ADULT || (Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && !IS_RANDO) || IS_RANDO) { if (Actor_HasParent(&this->actor, play)) { if (!LINK_IS_ADULT) { - if (GameInteractor_Should(VB_GIVE_ITEM_MASTER_SWORD, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_MASTER_SWORD, true)) { Item_Give(play, ITEM_SWORD_MASTER); } play->csCtx.segment = D_808BB2F0; diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index f93e5910c..59c83fc82 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -340,7 +340,7 @@ void BossDodongo_Init(Actor* thisx, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, -890.0f, -1523.76f, -3304.0f, 0, 0, 0, WARP_DUNGEON_CHILD); Actor_Spawn(&play->actorCtx, play, ACTOR_BG_BREAKWALL, -890.0f, -1523.76f, -3304.0f, 0, 0, 0, 0x6000, true); - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, -690.0f, -1523.76f, -3304.0f, 0, 0, 0, 0, true); } } @@ -1845,7 +1845,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, PlayState* play) { if (this->unk_1DA == 820) { Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS_CLEAR); - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn( &play->actorCtx, play, ACTOR_ITEM_B_HEART, Math_SinS(this->actor.shape.rot.y) * -50.0f + this->actor.world.pos.x, this->actor.world.pos.y, diff --git a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 032a487a6..e004cc627 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -229,7 +229,7 @@ void BossFd_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, 0.0f, 100.0f, 0.0f, 0, 0, 0, WARP_DUNGEON_ADULT); - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, 0.0f, 100.0f, 200.0f, 0, 0, 0, 0, true); } } else { @@ -917,7 +917,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { this->actionFunc = BossFd_Wait; this->actor.world.pos.y -= 1000.0f; } - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, this->timers[0] == 7, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, this->timers[0] == 7)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0, true); } diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index f4c227a29..8e2fffe36 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -581,7 +581,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { BossGanon_SetIntroCsCamera(this, 11); this->unk_198 = 2; this->timers[2] = 110; - if (GameInteractor_Should(VB_GANON_HEAL_BEFORE_FIGHT, true, NULL)) { + if (GameInteractor_Should(VB_GANON_HEAL_BEFORE_FIGHT, true)) { gSaveContext.healthAccumulator = 0x140; } Audio_QueueSeqCmd(NA_BGM_STOP); diff --git a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 1a1b0c24b..03c3cb292 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -237,7 +237,7 @@ void BossGanondrof_Init(Actor* thisx, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_DOOR_WARP1, GND_BOSSROOM_CENTER_X, GND_BOSSROOM_CENTER_Y, GND_BOSSROOM_CENTER_Z, 0, 0, 0, WARP_DUNGEON_ADULT, true); } - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, 200.0f + GND_BOSSROOM_CENTER_X, GND_BOSSROOM_CENTER_Y, GND_BOSSROOM_CENTER_Z, 0, 0, 0, 0, true); } @@ -966,7 +966,7 @@ void BossGanondrof_Death(BossGanondrof* this, PlayState* play) { bodyDecayLevel = 1; break; } - if (GameInteractor_Should(VB_PHANTOM_GANON_DEATH_SCENE, true, NULL)) { + if (GameInteractor_Should(VB_PHANTOM_GANON_DEATH_SCENE, true)) { Math_ApproachS(&this->actor.shape.rot.y, this->work[GND_VARIANCE_TIMER] * -100, 5, 0xBB8); Math_ApproachF(&this->cameraNextEye.z, this->targetPos.z + 60.0f, 0.02f, 0.5f); Math_ApproachF(&this->actor.world.pos.y, GND_BOSSROOM_CENTER_Y + 133.0f, 0.05f, 100.0f); @@ -1081,7 +1081,7 @@ void BossGanondrof_Death(BossGanondrof* this, PlayState* play) { this->deathCamera = 0; func_80064534(play, &play->csCtx); Player_SetCsActionWithHaltedActors(play, &this->actor, 7); - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, GND_BOSSROOM_CENTER_X, GND_BOSSROOM_CENTER_Y, GND_BOSSROOM_CENTER_Z + 200.0f, 0, 0, 0, 0, true); } diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 3e0096ece..0644f73a8 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -344,7 +344,7 @@ void BossGoma_Init(Actor* thisx, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, 0.0f, -640.0f, 0.0f, 0, 0, 0, WARP_DUNGEON_CHILD); } - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, 141.0f, -640.0f, -84.0f, 0, 0, 0, 0, true); } } @@ -1123,7 +1123,7 @@ void BossGoma_Defeated(BossGoma* this, PlayState* play) { this->timer = 70; this->decayingProgress = 0; this->subCameraFollowSpeed = 0.0f; - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0, true); } diff --git a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 6551f25b0..12dfd415a 100644 --- a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -375,7 +375,7 @@ void BossMo_Init(Actor* thisx, PlayState* play2) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, 0.0f, -280.0f, 0.0f, 0, 0, 0, WARP_DUNGEON_ADULT); } - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, -200.0f, -280.0f, 0.0f, 0, 0, 0, 0, true); } play->roomCtx.unk_74[0] = 0xFF; @@ -1127,7 +1127,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { WARP_DUNGEON_ADULT); } - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, this->actor.world.pos.x + 200.0f, -280.0f, this->actor.world.pos.z, 0, 0, 0, 0, true); } diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 6a4b0f30c..a739bfd96 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -298,7 +298,7 @@ void BossSst_Init(Actor* thisx, PlayState* play2) { Actor_Spawn(&play->actorCtx, play, ACTOR_DOOR_WARP1, ROOM_CENTER_X, ROOM_CENTER_Y, ROOM_CENTER_Z + 400.0f, 0, 0, 0, WARP_DUNGEON_ADULT, true); } - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, ROOM_CENTER_X, ROOM_CENTER_Y, ROOM_CENTER_Z - 200.0f, 0, 0, 0, 0, true); } @@ -1211,7 +1211,7 @@ void BossSst_HeadFinish(BossSst* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_DOOR_WARP1, ROOM_CENTER_X, ROOM_CENTER_Y, ROOM_CENTER_Z, 0, 0, 0, WARP_DUNGEON_ADULT, true); } - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, (Math_SinS(this->actor.shape.rot.y) * 200.0f) + ROOM_CENTER_X, ROOM_CENTER_Y, Math_CosS(this->actor.shape.rot.y) * 200.0f + ROOM_CENTER_Z, 0, 0, 0, 0, true); diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 4c198d07f..f92526337 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -541,7 +541,7 @@ void BossTw_Init(Actor* thisx, PlayState* play2) { 0, 0, WARP_DUNGEON_ADULT); } - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, -600.0f, 230.0f, 0.0f, 0, 0, 0, 0, true); } } else { @@ -2806,7 +2806,7 @@ void BossTw_TwinrovaDeathCS(BossTw* this, PlayState* play) { 0, 0, WARP_DUNGEON_ADULT); } - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, -600.0f, 230.f, 0.0f, 0, 0, 0, 0, true); } diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 16cb91d99..fc00e641b 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -648,7 +648,7 @@ void BossVa_Init(Actor* thisx, PlayState* play2) { 0, true); //! params could be WARP_DUNGEON_CHILD however this can also spawn Ru1 } - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, this->actor.world.pos.x + 160.0f, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0, true); } @@ -1662,7 +1662,7 @@ void BossVa_BodyDeath(BossVa* this, PlayState* play) { Player_SetCsActionWithHaltedActors(play, &this->actor, 7); sCsState++; - if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true, NULL)) { + if (GameInteractor_Should(VB_SPAWN_HEART_CONTAINER, true)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0, true); } diff --git a/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.c b/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.c index b0804724a..73f6c2e6d 100644 --- a/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -185,7 +185,7 @@ void func_80969F38(DemoDu* this, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, DEMO_EFFECT_MEDAL_FIRE); - if (GameInteractor_Should(VB_GIVE_ITEM_FIRE_MEDALLION, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_FIRE_MEDALLION, true)) { Item_Give(play, ITEM_MEDALLION_FIRE); } } @@ -204,7 +204,7 @@ void DemoDu_CsFireMedallion_AdvanceTo01(DemoDu* this, PlayState* play) { this->updateIndex = CS_FIREMEDALLION_SUBSCENE(1); play->csCtx.segment = D_8096C1A4; gSaveContext.cutsceneTrigger = 2; - if (GameInteractor_Should(VB_GIVE_ITEM_FIRE_MEDALLION, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_FIRE_MEDALLION, true)) { Item_Give(play, ITEM_MEDALLION_FIRE); } @@ -1054,4 +1054,4 @@ const ActorInit Demo_Du_InitVars = { void DemoDu_Reset(void) { D_8096CE94 = 0; -} \ No newline at end of file +} diff --git a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index ca8713805..1a502127c 100644 --- a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -319,7 +319,7 @@ void func_809853B4(DemoIm* this, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DEMO_EFFECT, playerX, playerY, playerZ, 0, 0, 0, 0xD); - if (GameInteractor_Should(VB_GIVE_ITEM_SHADOW_MEDALLION, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_SHADOW_MEDALLION, true)) { Item_Give(play, ITEM_MEDALLION_SHADOW); } } @@ -337,7 +337,7 @@ void func_8098544C(DemoIm* this, PlayState* play) { this->action = 1; play->csCtx.segment = D_8098786C; gSaveContext.cutsceneTrigger = 2; - if (GameInteractor_Should(VB_GIVE_ITEM_SHADOW_MEDALLION, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_SHADOW_MEDALLION, true)) { Item_Give(play, ITEM_MEDALLION_SHADOW); } player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; @@ -916,7 +916,7 @@ void func_80986C30(DemoIm* this, PlayState* play) { func_80985F54(this); } Flags_SetEventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY); - if (GameInteractor_Should(VB_GIVE_ITEM_ZELDAS_LULLABY, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_ZELDAS_LULLABY, true)) { Item_Give(play, ITEM_SONG_LULLABY); } } diff --git a/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c b/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c index 26bf4c761..59b19c5c7 100644 --- a/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -241,7 +241,7 @@ void func_8098E8C8(DemoSa* this, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 0xB); - if (GameInteractor_Should(VB_GIVE_ITEM_FOREST_MEDALLION, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_FOREST_MEDALLION, true)) { Item_Give(play, ITEM_MEDALLION_FOREST); } } @@ -259,7 +259,7 @@ void func_8098E960(DemoSa* this, PlayState* play) { this->action = 1; play->csCtx.segment = D_8099010C; gSaveContext.cutsceneTrigger = 2; - if (GameInteractor_Should(VB_GIVE_ITEM_FOREST_MEDALLION, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_FOREST_MEDALLION, true)) { Item_Give(play, ITEM_MEDALLION_FOREST); } player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; diff --git a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 8f4ee815c..4b0e93f52 100644 --- a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -120,7 +120,7 @@ void func_809B0524(EnAni* this, PlayState* play) { } void func_809B0558(EnAni* this, PlayState* play) { - if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_FROM_MAN_ON_ROOF, true, NULL)) { + if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_FROM_MAN_ON_ROOF, true)) { this->actor.parent = NULL; if (!LINK_IS_ADULT) { EnAni_SetupAction(this, func_809B04F0); @@ -129,7 +129,7 @@ void func_809B0558(EnAni* this, PlayState* play) { } Flags_SetItemGetInf(ITEMGETINF_15); } else { - if (GameInteractor_Should(VB_GIVE_ITEM_FROM_MAN_ON_ROOF, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_FROM_MAN_ON_ROOF, true)) { Actor_OfferGetItem(&this->actor, play, GI_HEART_PIECE, 10000.0f, 200.0f); } } @@ -140,7 +140,7 @@ void func_809B05F0(EnAni* this, PlayState* play) { EnAni_SetupAction(this, func_809B0558); } - if (GameInteractor_Should(VB_GIVE_ITEM_FROM_MAN_ON_ROOF, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_FROM_MAN_ON_ROOF, true)) { Actor_OfferGetItem(&this->actor, play, GI_HEART_PIECE, 10000.0f, 200.0f); } } diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 26e7f7e7a..9e3c9c1b2 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -143,7 +143,7 @@ void EnBomBowMan_BlinkAwake(EnBomBowlMan* this, PlayState* play) { if (frameCount == 30.0f) { this->dialogState = TEXT_STATE_EVENT; - if (GameInteractor_Should(VB_BE_ABLE_TO_PLAY_BOMBCHU_BOWLING, (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) || BREG(2), NULL)) { + if (GameInteractor_Should(VB_BE_ABLE_TO_PLAY_BOMBCHU_BOWLING, (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) || BREG(2))) { this->actor.textId = 0xBF; } else { this->actor.textId = 0x7058; diff --git a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 09d312318..874b62cea 100644 --- a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -166,7 +166,7 @@ void EnDs_OfferOddPotion(EnDs* this, PlayState* play) { s32 EnDs_CheckRupeesAndBottle() { if (GameInteractor_Should(VB_GRANNY_SAY_INSUFFICIENT_RUPEES, gSaveContext.rupees < 100, NULL)) { return 0; - } else if (GameInteractor_Should(VB_NEED_BOTTLE_FOR_GRANNYS_ITEM, Inventory_HasEmptyBottle() == 0, NULL)) { + } else if (GameInteractor_Should(VB_NEED_BOTTLE_FOR_GRANNYS_ITEM, Inventory_HasEmptyBottle() == 0)) { return 1; } else { return 2; diff --git a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c index 7d18395e8..916d2a76e 100644 --- a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -377,7 +377,7 @@ void func_809FE4A4(EnDu* this, PlayState* play) { play->msgCtx.ocarinaMode = OCARINA_MODE_00; EnDu_SetupAction(this, func_809FE3C0); } else if (play->msgCtx.ocarinaMode >= OCARINA_MODE_06) { - if (GameInteractor_Should(VB_PLAY_DARUNIAS_JOY_CS, true, NULL)) { + if (GameInteractor_Should(VB_PLAY_DARUNIAS_JOY_CS, true)) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDaruniaWrongCs); gSaveContext.cutsceneTrigger = 1; } @@ -386,7 +386,7 @@ void func_809FE4A4(EnDu* this, PlayState* play) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (GameInteractor_Should(VB_PLAY_DARUNIAS_JOY_CS, true, NULL)) { + if (GameInteractor_Should(VB_PLAY_DARUNIAS_JOY_CS, true)) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDaruniaCorrectCs); gSaveContext.cutsceneTrigger = 1; } @@ -554,7 +554,7 @@ void func_809FEB08(EnDu* this, PlayState* play) { EnDu_SetupAction(this, func_809FE3C0); return; } - if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_DARUNIAS_JOY_REWARD, CUR_UPG_VALUE(UPG_STRENGTH) <= 0, NULL)) { + if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_DARUNIAS_JOY_REWARD, CUR_UPG_VALUE(UPG_STRENGTH) <= 0)) { Flags_SetRandomizerInf(RAND_INF_DARUNIAS_JOY); this->actor.textId = 0x301C; EnDu_SetupAction(this, func_809FEC14); @@ -576,7 +576,7 @@ void func_809FEC14(EnDu* this, PlayState* play) { } void func_809FEC70(EnDu* this, PlayState* play) { - if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_STRENGTH_1, true, NULL)) { + if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_STRENGTH_1, true)) { this->actor.parent = NULL; EnDu_SetupAction(this, func_809FECE4); } else { diff --git a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index facd43466..91eb44530 100644 --- a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -134,7 +134,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { case GE1_TYPE_GATE_OPERATOR: this->hairstyle = GE1_HAIR_STRAIGHT; - if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe1_CheckCarpentersFreed(), NULL)) { + if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe1_CheckCarpentersFreed())) { this->actionFunc = EnGe1_CheckGate_GateOp; } else { this->actionFunc = EnGe1_WatchForPlayerFrontOnly; @@ -144,7 +144,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { case GE1_TYPE_NORMAL: this->hairstyle = GE1_HAIR_STRAIGHT; - if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe1_CheckCarpentersFreed(), NULL)) { + if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe1_CheckCarpentersFreed())) { this->actionFunc = EnGe1_SetNormalText; } else { this->actionFunc = EnGe1_WatchForAndSensePlayer; @@ -174,7 +174,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { if (gSaveContext.eventInf[0] & 0x100) { this->actionFunc = EnGe1_TalkAfterGame_Archery; - } else if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe1_CheckCarpentersFreed(), NULL)) { + } else if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe1_CheckCarpentersFreed())) { this->actionFunc = EnGe1_Wait_Archery; } else { this->actionFunc = EnGe1_WatchForPlayerFrontOnly; @@ -184,7 +184,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { case GE1_TYPE_TRAINING_GROUNDS_GUARD: this->hairstyle = GE1_HAIR_STRAIGHT; - if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe1_CheckCarpentersFreed(), NULL)) { + if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe1_CheckCarpentersFreed())) { this->actionFunc = EnGe1_CheckForCard_GTGGuard; } else { this->actionFunc = EnGe1_WatchForPlayerFrontOnly; diff --git a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 9c4db10ac..0e26fca52 100644 --- a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -140,14 +140,14 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { switch (this->actor.params & 0xFF) { case GE2_TYPE_PATROLLING: EnGe2_ChangeAction(this, GE2_ACTION_WALK); - if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe2_CheckCarpentersFreed(), NULL)) { + if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe2_CheckCarpentersFreed())) { this->actor.update = EnGe2_UpdateFriendly; this->actor.targetMode = 6; } break; case GE2_TYPE_STATIONARY: EnGe2_ChangeAction(this, GE2_ACTION_STAND); - if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe2_CheckCarpentersFreed(), NULL)) { + if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe2_CheckCarpentersFreed())) { this->actor.update = EnGe2_UpdateFriendly; this->actor.targetMode = 6; } @@ -460,7 +460,7 @@ void EnGe2_WaitLookAtPlayer(EnGe2* this, PlayState* play) { } void EnGe2_WaitTillCardGiven(EnGe2* this, PlayState* play) { - if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_GERUDO_MEMBERSHIP_CARD, true, NULL)) { + if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_GERUDO_MEMBERSHIP_CARD, true)) { this->actor.parent = NULL; this->actionFunc = EnGe2_SetActionAfterTalk; } else { @@ -473,7 +473,7 @@ void EnGe2_GiveCard(EnGe2* this, PlayState* play) { Message_CloseTextbox(play); this->actor.flags &= ~ACTOR_FLAG_WILL_TALK; this->actionFunc = EnGe2_WaitTillCardGiven; - if (GameInteractor_Should(VB_GIVE_ITEM_GERUDO_MEMBERSHIP_CARD, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_GERUDO_MEMBERSHIP_CARD, true)) { Actor_OfferGetItem(&this->actor, play, GI_GERUDO_CARD, 10000.0f, 50.0f); } } @@ -605,7 +605,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { } EnGe2_MoveAndBlink(this, play); - if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe2_CheckCarpentersFreed(), NULL) && !(this->stateFlags & GE2_STATE_KO)) { + if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe2_CheckCarpentersFreed()) && !(this->stateFlags & GE2_STATE_KO)) { this->actor.update = EnGe2_UpdateFriendly; this->actor.targetMode = 6; } @@ -630,7 +630,7 @@ void EnGe2_UpdateStunned(Actor* thisx, PlayState* play2) { } CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); - if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe2_CheckCarpentersFreed(), NULL)) { + if (GameInteractor_Should(VB_GERUDOS_BE_FRIENDLY, EnGe2_CheckCarpentersFreed())) { this->actor.update = EnGe2_UpdateFriendly; this->actor.targetMode = 6; this->actor.colorFilterTimer = 0; diff --git a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index 81840dc1c..eb3042dd3 100644 --- a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -141,7 +141,7 @@ void EnGe3_WaitLookAtPlayer(EnGe3* this, PlayState* play) { } void EnGe3_WaitTillCardGiven(EnGe3* this, PlayState* play) { - if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_GERUDO_MEMBERSHIP_CARD, true, NULL)) { + if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_GERUDO_MEMBERSHIP_CARD, true)) { this->actor.parent = NULL; this->actionFunc = EnGe3_Wait; } else { @@ -154,7 +154,7 @@ void EnGe3_GiveCard(EnGe3* this, PlayState* play) { Message_CloseTextbox(play); this->actor.flags &= ~ACTOR_FLAG_WILL_TALK; this->actionFunc = EnGe3_WaitTillCardGiven; - if (GameInteractor_Should(VB_GIVE_ITEM_GERUDO_MEMBERSHIP_CARD, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_GERUDO_MEMBERSHIP_CARD, true)) { Actor_OfferGetItem(&this->actor, play, GI_GERUDO_CARD, 10000.0f, 50.0f); } } diff --git a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c index af1f26f19..5ca459672 100644 --- a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -99,7 +99,7 @@ s32 func_80A3D7C8(void) { return 0; } else if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_GIANTS_KNIFE_PURCHASE, ( !CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BIGGORON) // Don't have giant's knife - ), NULL)) { + ))) { return 1; } else if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) { // Have broken giant's knife return 2; diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index d20a19aec..f4ef8703f 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -407,9 +407,9 @@ s16 EnGo2_UpdateTalkStateGoronDmtRollingSmall(PlayState* play, EnGo2* this) { } u16 EnGo2_GetTextIdGoronDmtDcEntrance(PlayState* play, EnGo2* this) { - if (GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE), NULL) && LINK_IS_ADULT) { + if (GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) && LINK_IS_ADULT) { return 0x3043; - } else if (GameInteractor_Should(VB_GORONS_CONSIDER_DODONGOS_CAVERN_FINISHED, CHECK_QUEST_ITEM(QUEST_GORON_RUBY), NULL)) { + } else if (GameInteractor_Should(VB_GORONS_CONSIDER_DODONGOS_CAVERN_FINISHED, CHECK_QUEST_ITEM(QUEST_GORON_RUBY))) { return 0x3027; } else { return Flags_GetEventChkInf(EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE) ? 0x3021 : Flags_GetInfTable(INFTABLE_E0) ? 0x302A : 0x3008; @@ -428,9 +428,9 @@ s16 EnGo2_UpdateTalkStateGoronDmtDcEntrance(PlayState* play, EnGo2* this) { } u16 EnGo2_GetTextIdGoronCityEntrance(PlayState* play, EnGo2* this) { - if (GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE), NULL) && LINK_IS_ADULT) { + if (GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) && LINK_IS_ADULT) { return 0x3043; - } else if (GameInteractor_Should(VB_GORONS_CONSIDER_DODONGOS_CAVERN_FINISHED, CHECK_QUEST_ITEM(QUEST_GORON_RUBY), NULL)) { + } else if (GameInteractor_Should(VB_GORONS_CONSIDER_DODONGOS_CAVERN_FINISHED, CHECK_QUEST_ITEM(QUEST_GORON_RUBY))) { return 0x3027; } else { return Flags_GetInfTable(INFTABLE_F0) ? 0x3015 : 0x3014; @@ -449,9 +449,9 @@ s16 EnGo2_UpdateTalkStateGoronCityEntrance(PlayState* play, EnGo2* this) { } u16 EnGo2_GetTextIdGoronCityIsland(PlayState* play, EnGo2* this) { - if (GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE), NULL) && LINK_IS_ADULT) { + if (GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) && LINK_IS_ADULT) { return 0x3043; - } else if (GameInteractor_Should(VB_GORONS_CONSIDER_DODONGOS_CAVERN_FINISHED, CHECK_QUEST_ITEM(QUEST_GORON_RUBY), NULL)) { + } else if (GameInteractor_Should(VB_GORONS_CONSIDER_DODONGOS_CAVERN_FINISHED, CHECK_QUEST_ITEM(QUEST_GORON_RUBY))) { return 0x3027; } else { return Flags_GetInfTable(INFTABLE_F4) ? 0x3017 : 0x3016; @@ -470,9 +470,9 @@ s16 EnGo2_UpdateTalkStateGoronCityIsland(PlayState* play, EnGo2* this) { } u16 EnGo2_GetTextIdGoronCityLowestFloor(PlayState* play, EnGo2* this) { - if (GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE), NULL) && LINK_IS_ADULT) { + if (GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) && LINK_IS_ADULT) { return 0x3043; - } else if (GameInteractor_Should(VB_GORONS_CONSIDER_DODONGOS_CAVERN_FINISHED, CHECK_QUEST_ITEM(QUEST_GORON_RUBY), NULL)) { + } else if (GameInteractor_Should(VB_GORONS_CONSIDER_DODONGOS_CAVERN_FINISHED, CHECK_QUEST_ITEM(QUEST_GORON_RUBY))) { return 0x3027; } else { return CUR_UPG_VALUE(UPG_STRENGTH) != 0 ? 0x302C @@ -500,9 +500,9 @@ u16 EnGo2_GetTextIdGoronCityLink(PlayState* play, EnGo2* this) { return overrideTextId; } - if (GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE), NULL)) { + if (GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE))) { return Flags_GetInfTable(INFTABLE_10F) ? 0x3042 : 0x3041; - } else if (GameInteractor_Should(VB_GORONS_CONSIDER_TUNIC_COLLECTED, CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON), NULL)) { + } else if (GameInteractor_Should(VB_GORONS_CONSIDER_TUNIC_COLLECTED, CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON))) { return Flags_GetInfTable(INFTABLE_SPOKE_TO_GORON_LINK) ? 0x3038 : 0x3037; } else if (Flags_GetInfTable(INFTABLE_STOPPED_GORON_LINKS_ROLLING)) { this->unk_20C = 0; @@ -568,7 +568,7 @@ s16 EnGo2_UpdateTalkStateGoronCityLink(PlayState* play, EnGo2* this) { u16 EnGo2_GetTextIdGoronDmtBiggoron(PlayState* play, EnGo2* this) { Player* player = GET_PLAYER(play); - if (GameInteractor_Should(VB_BIGGORON_CONSIDER_TRADE_COMPLETE, gSaveContext.bgsFlag, NULL)) { + if (GameInteractor_Should(VB_BIGGORON_CONSIDER_TRADE_COMPLETE, gSaveContext.bgsFlag)) { player->exchangeItemId = EXCH_ITEM_CLAIM_CHECK; return 0x305E; } else if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_CLAIM_CHECK) { @@ -590,7 +590,7 @@ s16 EnGo2_UpdateTalkStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { switch (EnGo2_GetDialogState(this, play)) { case TEXT_STATE_DONE: if (this->actor.textId == 0x305E) { - if (!GameInteractor_Should(VB_BIGGORON_CONSIDER_SWORD_COLLECTED, gSaveContext.bgsFlag, NULL)) { + if (!GameInteractor_Should(VB_BIGGORON_CONSIDER_SWORD_COLLECTED, gSaveContext.bgsFlag)) { Flags_SetRandomizerInf(RAND_INF_ADULT_TRADES_DMT_TRADE_CLAIM_CHECK); EnGo2_GetItem(this, play, GI_SWORD_BGS); this->actionFunc = EnGo2_SetupGetItem; @@ -1022,7 +1022,7 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { u16 textId; if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { - if (GameInteractor_Should(VB_BIGGORON_CONSIDER_TRADE_COMPLETE, gSaveContext.bgsFlag, NULL)) { + if (GameInteractor_Should(VB_BIGGORON_CONSIDER_TRADE_COMPLETE, gSaveContext.bgsFlag)) { if (func_8002F368(play) == EXCH_ITEM_CLAIM_CHECK) { this->actor.textId = 0x3003; } else { @@ -1031,18 +1031,18 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { player->actor.textId = this->actor.textId; } else if ( - !GameInteractor_Should(VB_BIGGORON_CONSIDER_SWORD_COLLECTED, gSaveContext.bgsFlag, NULL) && + !GameInteractor_Should(VB_BIGGORON_CONSIDER_SWORD_COLLECTED, gSaveContext.bgsFlag) && (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK) ) { if (func_8002F368(play) == EXCH_ITEM_CLAIM_CHECK) { - if (GameInteractor_Should(VB_BIGGORON_CONSIDER_SWORD_FORGED, Environment_GetBgsDayCount() >= 3, NULL)) { + if (GameInteractor_Should(VB_BIGGORON_CONSIDER_SWORD_FORGED, Environment_GetBgsDayCount() >= 3)) { textId = 0x305E; } else { textId = 0x305D; } this->actor.textId = textId; } else { - if (GameInteractor_Should(VB_BIGGORON_CONSIDER_SWORD_FORGED, Environment_GetBgsDayCount() >= 3, NULL)) { + if (GameInteractor_Should(VB_BIGGORON_CONSIDER_SWORD_FORGED, Environment_GetBgsDayCount() >= 3)) { textId = 0x3002; } else { textId = 0x305D; @@ -1171,8 +1171,8 @@ s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) { (this->actor.params & 0x1F) == GORON_MARKET_BAZAAR) { return true; } else if ( - !GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE), NULL) && - GameInteractor_Should(VB_GORONS_CONSIDER_TUNIC_COLLECTED, CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON), NULL) + !GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) && + GameInteractor_Should(VB_GORONS_CONSIDER_TUNIC_COLLECTED, CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON)) ) { return true; } else { @@ -1231,8 +1231,8 @@ void EnGo2_SelectGoronWakingUp(EnGo2* this) { break; case GORON_CITY_LINK: if ( - !GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE), NULL) && - GameInteractor_Should(VB_GORONS_CONSIDER_TUNIC_COLLECTED, CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON), NULL) + !GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) && + GameInteractor_Should(VB_GORONS_CONSIDER_TUNIC_COLLECTED, CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON)) ) { EnGo2_WakingUp(this); break; @@ -1561,7 +1561,7 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { case GORON_CITY_LOWEST_FLOOR: case GORON_CITY_STAIRWELL: case GORON_CITY_LOST_WOODS: - if (!GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE), NULL) && LINK_IS_ADULT) { + if (!GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) && LINK_IS_ADULT) { Actor_Kill(&this->actor); } this->actionFunc = EnGo2_CurledUp; @@ -1577,8 +1577,8 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { Path_CopyLastPoint(this->path, &this->actor.world.pos); this->actor.home.pos = this->actor.world.pos; if ( - !GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE), NULL) && - GameInteractor_Should(VB_GORONS_CONSIDER_TUNIC_COLLECTED, CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON), NULL) + !GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) && + GameInteractor_Should(VB_GORONS_CONSIDER_TUNIC_COLLECTED, CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON)) ) { EnGo2_GetItemAnimation(this, play); } else { @@ -1795,7 +1795,7 @@ void EnGo2_ReverseRolling(EnGo2* this, PlayState* play) { } void EnGo2_SetupGetItem(EnGo2* this, PlayState* play) { - if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_FROM_GORON, true, NULL)) { + if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_FROM_GORON, true)) { this->actor.parent = NULL; this->actionFunc = EnGo2_SetGetItem; } else { @@ -1804,7 +1804,7 @@ void EnGo2_SetupGetItem(EnGo2* this, PlayState* play) { } void EnGo2_SetGetItem(EnGo2* this, PlayState* play) { - if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play) || !GameInteractor_Should(VB_GIVE_ITEM_FROM_GORON, true, NULL)) { + if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play) || !GameInteractor_Should(VB_GIVE_ITEM_FROM_GORON, true)) { this->interactInfo.talkState = NPC_TALK_STATE_IDLE; switch (this->getItemId) { case GI_CLAIM_CHECK: @@ -1816,7 +1816,7 @@ void EnGo2_SetGetItem(EnGo2* this, PlayState* play) { EnGo2_GetItemAnimation(this, play); return; case GI_SWORD_BGS: - if (GameInteractor_Should(VB_GIVE_ITEM_FROM_GORON, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_FROM_GORON, true)) { gSaveContext.bgsFlag = true; } break; @@ -1837,12 +1837,12 @@ void EnGo2_BiggoronEyedrops(EnGo2* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; this->actor.shape.rot.y += 0x5B0; this->trackingMode = NPC_TRACKING_NONE; - this->animTimer = !GameInteractor_Should(VB_PLAY_EYEDROPS_CS, true, NULL) ? 0 : (this->skelAnime.endFrame + 60.0f + 60.0f); // eyeDrops animation timer + this->animTimer = !GameInteractor_Should(VB_PLAY_EYEDROPS_CS, true) ? 0 : (this->skelAnime.endFrame + 60.0f + 60.0f); // eyeDrops animation timer this->eyeMouthTexState = 2; this->unk_20C = 0; this->goronState++; func_800F483C(0x28, 5); - if (GameInteractor_Should(VB_PLAY_EYEDROPS_CS, true, NULL)) { + if (GameInteractor_Should(VB_PLAY_EYEDROPS_CS, true)) { OnePointCutscene_Init(play, 4190, -99, &this->actor, MAIN_CAM); } break; diff --git a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c index f6e48a913..af9f83fc2 100644 --- a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -130,7 +130,7 @@ void func_80A6E5EC(EnHs* this, PlayState* play) { void func_80A6E630(EnHs* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - if (GameInteractor_Should(VB_TRADE_TIMER_ODD_MUSHROOM, true, NULL)) { + if (GameInteractor_Should(VB_TRADE_TIMER_ODD_MUSHROOM, true)) { func_80088AA0(180); gSaveContext.eventInf[1] &= ~1; } diff --git a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index 08d1e1c98..38331e50b 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -119,7 +119,7 @@ void func_80A90264(EnKakasi2* this, PlayState* play) { this->unk_194++; - if ((BREG(1) != 0) || GameInteractor_Should(VB_SKIP_SCARECROWS_SONG, false, NULL) && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && + if ((BREG(1) != 0) || GameInteractor_Should(VB_SKIP_SCARECROWS_SONG, false) && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y)) { this->actor.draw = func_80A90948; Collider_InitCylinder(play, &this->collider); diff --git a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 5bc2b690d..2bef0d30f 100644 --- a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -524,7 +524,7 @@ void EnKz_SetupGetItem(EnKz* this, PlayState* play) { void EnKz_StartTimer(EnKz* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_FROG && GameInteractor_Should(VB_TRADE_TIMER_FROG, true, NULL)) { + if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_FROG && GameInteractor_Should(VB_TRADE_TIMER_FROG, true)) { func_80088AA0(180); // start timer2 with 3 minutes gSaveContext.eventInf[1] &= ~1; } diff --git a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index c9521b133..e8a79b437 100644 --- a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -91,8 +91,8 @@ static void* sEyeTextures[] = { }; u16 EnMa1_GetText(PlayState* play, Actor* thisx) { - bool malonReturnedFromCastle = GameInteractor_Should(VB_MALON_RETURN_FROM_CASTLE, Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE), NULL); - bool malonTaughtEponasSong = GameInteractor_Should(VB_MALON_ALREADY_TAUGHT_EPONAS_SONG, CHECK_QUEST_ITEM(QUEST_SONG_EPONA), NULL); + bool malonReturnedFromCastle = GameInteractor_Should(VB_MALON_RETURN_FROM_CASTLE, Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)); + bool malonTaughtEponasSong = GameInteractor_Should(VB_MALON_ALREADY_TAUGHT_EPONAS_SONG, CHECK_QUEST_ITEM(QUEST_SONG_EPONA)); u16 faceReaction = Text_GetFaceReaction(play, 0x17); if (faceReaction != 0) { @@ -185,7 +185,7 @@ s16 func_80AA0778(PlayState* play, Actor* thisx) { } s32 func_80AA08C4(EnMa1* this, PlayState* play) { - bool malonReturnedFromCastle = GameInteractor_Should(VB_MALON_RETURN_FROM_CASTLE, Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE), NULL); + bool malonReturnedFromCastle = GameInteractor_Should(VB_MALON_RETURN_FROM_CASTLE, Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)); if ((this->actor.shape.rot.z == 3) && (gSaveContext.sceneSetupIndex == 5)) { return 1; @@ -269,8 +269,8 @@ void func_80AA0B74(EnMa1* this) { void EnMa1_Init(Actor* thisx, PlayState* play) { EnMa1* this = (EnMa1*)thisx; - bool malonReturnedFromCastle = GameInteractor_Should(VB_MALON_RETURN_FROM_CASTLE, Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE), NULL); - bool malonTaughtEponasSong = GameInteractor_Should(VB_MALON_ALREADY_TAUGHT_EPONAS_SONG, CHECK_QUEST_ITEM(QUEST_SONG_EPONA), NULL); + bool malonReturnedFromCastle = GameInteractor_Should(VB_MALON_RETURN_FROM_CASTLE, Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)); + bool malonTaughtEponasSong = GameInteractor_Should(VB_MALON_ALREADY_TAUGHT_EPONAS_SONG, CHECK_QUEST_ITEM(QUEST_SONG_EPONA)); s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); @@ -306,8 +306,8 @@ void EnMa1_Destroy(Actor* thisx, PlayState* play) { } void func_80AA0D88(EnMa1* this, PlayState* play) { - bool malonReturnedFromCastle = GameInteractor_Should(VB_MALON_RETURN_FROM_CASTLE, Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE), NULL); - bool malonTaughtEponasSong = GameInteractor_Should(VB_MALON_ALREADY_TAUGHT_EPONAS_SONG, CHECK_QUEST_ITEM(QUEST_SONG_EPONA), NULL); + bool malonReturnedFromCastle = GameInteractor_Should(VB_MALON_RETURN_FROM_CASTLE, Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)); + bool malonTaughtEponasSong = GameInteractor_Should(VB_MALON_ALREADY_TAUGHT_EPONAS_SONG, CHECK_QUEST_ITEM(QUEST_SONG_EPONA)); if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { if (this->skelAnime.animation != &gMalonChildIdleAnim) { @@ -331,7 +331,7 @@ void func_80AA0D88(EnMa1* this, PlayState* play) { } void func_80AA0EA0(EnMa1* this, PlayState* play) { - if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_WEIRD_EGG, true, NULL)) { + if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_WEIRD_EGG, true)) { this->actor.parent = NULL; this->actionFunc = func_80AA0EFC; } else { @@ -340,7 +340,7 @@ void func_80AA0EA0(EnMa1* this, PlayState* play) { } void func_80AA0EFC(EnMa1* this, PlayState* play) { - if (this->interactInfo.talkState == NPC_TALK_STATE_ITEM_GIVEN || !GameInteractor_Should(VB_GIVE_ITEM_WEIRD_EGG, true, NULL)) { + if (this->interactInfo.talkState == NPC_TALK_STATE_ITEM_GIVEN || !GameInteractor_Should(VB_GIVE_ITEM_WEIRD_EGG, true)) { this->interactInfo.talkState = NPC_TALK_STATE_IDLE; this->actionFunc = func_80AA0D88; Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG); diff --git a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c index 148882730..36a8b34c5 100644 --- a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -97,7 +97,7 @@ void func_80AACA94(EnMk* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = func_80AACA40; Flags_SetRandomizerInf(RAND_INF_ADULT_TRADES_LH_TRADE_FROG); - if (GameInteractor_Should(VB_TRADE_TIMER_EYEDROPS, true, NULL)) { + if (GameInteractor_Should(VB_TRADE_TIMER_EYEDROPS, true)) { func_80088AA0(240); gSaveContext.eventInf[1] &= ~1; } diff --git a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 1cb2d7908..c24e00e84 100644 --- a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -327,7 +327,7 @@ void EnNb_GiveMedallion(EnNb* this, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 0xC); - if (GameInteractor_Should(VB_GIVE_ITEM_SPIRIT_MEDALLION, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_SPIRIT_MEDALLION, true)) { Item_Give(play, ITEM_MEDALLION_SPIRIT); } } @@ -345,7 +345,7 @@ void EnNb_SetupChamberCsImpl(EnNb* this, PlayState* play) { this->action = NB_CHAMBER_UNDERGROUND; play->csCtx.segment = &D_80AB431C; gSaveContext.cutsceneTrigger = 2; - if (GameInteractor_Should(VB_GIVE_ITEM_SPIRIT_MEDALLION, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_SPIRIT_MEDALLION, true)) { Item_Give(play, ITEM_MEDALLION_SPIRIT); } player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; diff --git a/soh/src/overlays/actors/ovl_En_Rl/z_en_rl.c b/soh/src/overlays/actors/ovl_En_Rl/z_en_rl.c index e321540af..12b23037d 100644 --- a/soh/src/overlays/actors/ovl_En_Rl/z_en_rl.c +++ b/soh/src/overlays/actors/ovl_En_Rl/z_en_rl.c @@ -127,7 +127,7 @@ void func_80AE7590(EnRl* this, PlayState* play) { pos.y = player->actor.world.pos.y + 80.0f; pos.z = player->actor.world.pos.z; Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_EFFECT, pos.x, pos.y, pos.z, 0, 0, 0, 0xE, true); - if (GameInteractor_Should(VB_GIVE_ITEM_LIGHT_MEDALLION, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_LIGHT_MEDALLION, true)) { Item_Give(play, ITEM_MEDALLION_LIGHT); } this->lightMedallionGiven = 1; diff --git a/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 008e0b6a5..2905390bb 100644 --- a/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -261,7 +261,7 @@ void func_80AF2A38(EnRu2* this, PlayState* play) { f32 posZ = player->actor.world.pos.z; Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 10); - if (GameInteractor_Should(VB_GIVE_ITEM_WATER_MEDALLION, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_WATER_MEDALLION, true)) { Item_Give(play, ITEM_MEDALLION_WATER); } } @@ -276,7 +276,7 @@ void func_80AF2AB4(EnRu2* this, PlayState* play) { this->action = 1; play->csCtx.segment = &D_80AF411C; gSaveContext.cutsceneTrigger = 2; - if (GameInteractor_Should(VB_GIVE_ITEM_WATER_MEDALLION, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_WATER_MEDALLION, true)) { Item_Give(play, ITEM_MEDALLION_WATER); } temp = this->actor.world.rot.y + 0x8000; diff --git a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 73223218e..ff36e98d0 100644 --- a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -391,10 +391,10 @@ s32 func_80AF5DFC(EnSa* this, PlayState* play) { return 1; } if (play->sceneNum == SCENE_SACRED_FOREST_MEADOW && (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER))) { - return GameInteractor_Should(VB_BE_ELIGIBLE_FOR_SARIAS_SONG, !CHECK_QUEST_ITEM(QUEST_SONG_SARIA), NULL) ? 5 : 2; + return GameInteractor_Should(VB_BE_ELIGIBLE_FOR_SARIAS_SONG, !CHECK_QUEST_ITEM(QUEST_SONG_SARIA)) ? 5 : 2; } if (play->sceneNum == SCENE_KOKIRI_FOREST && !CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { - if (GameInteractor_Should(VB_NOT_BE_GREETED_BY_SARIA, Flags_GetInfTable(INFTABLE_GREETED_BY_SARIA), NULL)) { + if (GameInteractor_Should(VB_NOT_BE_GREETED_BY_SARIA, Flags_GetInfTable(INFTABLE_GREETED_BY_SARIA))) { return 1; } return 4; @@ -708,7 +708,7 @@ void func_80AF68E4(EnSa* this, PlayState* play) { void func_80AF6B20(EnSa* this, PlayState* play) { if (play->sceneNum == SCENE_SACRED_FOREST_MEADOW) { - if (GameInteractor_Should(VB_GIVE_ITEM_SARIAS_SONG, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_SARIAS_SONG, true)) { Item_Give(play, ITEM_SONG_SARIA); } EnSa_ChangeAnim(this, ENSA_ANIM1_6); diff --git a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index 88eeb6ebd..594d72bca 100644 --- a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -291,7 +291,7 @@ void func_80B20768(EnToryo* this, PlayState* play) { s16 sp32; s16 sp30; - if (this->unk_1E4 == 3 && !GameInteractor_Should(VB_FIX_SAW_SOFTLOCK, false, NULL)) { + if (this->unk_1E4 == 3 && !GameInteractor_Should(VB_FIX_SAW_SOFTLOCK, false)) { Actor_ProcessTalkRequest(&this->actor, play); Message_ContinueTextbox(play, this->actor.textId); this->unk_1E4 = 1; diff --git a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c index b51b7f630..991853c55 100644 --- a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -298,15 +298,15 @@ s32 EnXc_MinuetCS(EnXc* this, PlayState* play) { if (z < -2225.0f) { if (!Play_InCsMode(play)) { - if (GameInteractor_Should(VB_PLAY_MINUET_OF_FOREST_CS, true, NULL)) { + if (GameInteractor_Should(VB_PLAY_MINUET_OF_FOREST_CS, true)) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gMinuetCs); gSaveContext.cutsceneTrigger = 1; } Flags_SetEventChkInf(EVENTCHKINF_LEARNED_MINUET_OF_FOREST); - if (GameInteractor_Should(VB_GIVE_ITEM_MINUET_OF_FOREST, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_MINUET_OF_FOREST, true)) { Item_Give(play, ITEM_SONG_MINUET); } - if (GameInteractor_Should(VB_PLAY_MINUET_OF_FOREST_CS, true, NULL)) { + if (GameInteractor_Should(VB_PLAY_MINUET_OF_FOREST_CS, true)) { return true; } } @@ -335,15 +335,15 @@ s32 EnXc_BoleroCS(EnXc* this, PlayState* play) { if ((posRot->pos.x > -784.0f) && (posRot->pos.x < -584.0f) && (posRot->pos.y > 447.0f) && (posRot->pos.y < 647.0f) && (posRot->pos.z > -446.0f) && (posRot->pos.z < -246.0f) && !Play_InCsMode(play)) { - if (GameInteractor_Should(VB_PLAY_BOLERO_OF_FIRE_CS, true, NULL)) { + if (GameInteractor_Should(VB_PLAY_BOLERO_OF_FIRE_CS, true)) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gDeathMountainCraterBoleroCs); gSaveContext.cutsceneTrigger = 1; } Flags_SetEventChkInf(EVENTCHKINF_LEARNED_BOLERO_OF_FIRE); - if (GameInteractor_Should(VB_GIVE_ITEM_BOLERO_OF_FIRE, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_BOLERO_OF_FIRE, true)) { Item_Give(play, ITEM_SONG_BOLERO); } - if (GameInteractor_Should(VB_PLAY_BOLERO_OF_FIRE_CS, true, NULL)) { + if (GameInteractor_Should(VB_PLAY_BOLERO_OF_FIRE_CS, true)) { return true; } } @@ -354,7 +354,7 @@ s32 EnXc_BoleroCS(EnXc* this, PlayState* play) { void EnXc_SetupSerenadeAction(EnXc* this, PlayState* play) { // Player is adult and does not have iron boots and has not learned Serenade - if (GameInteractor_Should(VB_SHIEK_PREPARE_TO_GIVE_SERENADE_OF_WATER, (!CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER)) && LINK_IS_ADULT, NULL)) { + if (GameInteractor_Should(VB_SHIEK_PREPARE_TO_GIVE_SERENADE_OF_WATER, (!CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER)) && LINK_IS_ADULT)) { this->action = SHEIK_ACTION_SERENADE; osSyncPrintf("水のセレナーデ シーク誕生!!!!!!!!!!!!!!!!!!\n"); } else { @@ -367,18 +367,18 @@ s32 EnXc_SerenadeCS(EnXc* this, PlayState* play) { if (this->actor.params == SHEIK_TYPE_SERENADE) { Player* player = GET_PLAYER(play); s32 stateFlags = player->stateFlags1; - if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_SERENADE_OF_WATER, CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER), NULL) && + if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_SERENADE_OF_WATER, CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER)) && !(stateFlags & PLAYER_STATE1_IN_CUTSCENE) && !Play_InCsMode(play)) { - if (GameInteractor_Should(VB_PLAY_SERENADE_OF_WATER_CS, true, NULL)) { + if (GameInteractor_Should(VB_PLAY_SERENADE_OF_WATER_CS, true)) { Cutscene_SetSegment(play, &gIceCavernSerenadeCs); gSaveContext.cutsceneTrigger = 1; } Flags_SetEventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER); // Learned Serenade of Water Flag - if (GameInteractor_Should(VB_GIVE_ITEM_SERENADE_OF_WATER, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_SERENADE_OF_WATER, true)) { Item_Give(play, ITEM_SONG_SERENADE); } osSyncPrintf("ブーツを取った!!!!!!!!!!!!!!!!!!\n"); - if (GameInteractor_Should(VB_PLAY_SERENADE_OF_WATER_CS, true, NULL)) { + if (GameInteractor_Should(VB_PLAY_SERENADE_OF_WATER_CS, true)) { return true; } } @@ -2185,17 +2185,17 @@ void EnXc_InitTempleOfTime(EnXc* this, PlayState* play) { if (LINK_IS_ADULT) { if (!Flags_GetEventChkInf(EVENTCHKINF_SHEIK_SPAWNED_AT_MASTER_SWORD_PEDESTAL)) { Flags_SetEventChkInf(EVENTCHKINF_SHEIK_SPAWNED_AT_MASTER_SWORD_PEDESTAL); - if (GameInteractor_Should(VB_PLAY_SHIEK_BLOCK_MASTER_SWORD_CS, true, NULL)) { + if (GameInteractor_Should(VB_PLAY_SHIEK_BLOCK_MASTER_SWORD_CS, true)) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gTempleOfTimeFirstAdultCs); gSaveContext.cutsceneTrigger = 1; } func_80B3EBF0(this, play); - } else if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_PRELUDE_OF_LIGHT, !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP), NULL)) { + } else if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_PRELUDE_OF_LIGHT, !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP))) { Flags_SetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT); - if (GameInteractor_Should(VB_GIVE_ITEM_PRELUDE_OF_LIGHT, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_PRELUDE_OF_LIGHT, true)) { Item_Give(play, ITEM_SONG_PRELUDE); } - if (GameInteractor_Should(VB_PLAY_PRELUDE_OF_LIGHT_CS, true, NULL)) { + if (GameInteractor_Should(VB_PLAY_PRELUDE_OF_LIGHT_CS, true)) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gTempleOfTimePreludeCs); gSaveContext.cutsceneTrigger = 1; } diff --git a/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index 40351399e..79e3e95e4 100644 --- a/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -634,7 +634,7 @@ void EnZl2_GiveLightArrows(EnZl2* this, PlayState* play) { posY = player->actor.world.pos.y + 80.0f; posZ = player->actor.world.pos.z; Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 0x17, true); - if (GameInteractor_Should(VB_GIVE_ITEM_LIGHT_ARROW, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_LIGHT_ARROW, true)) { Item_Give(play, ITEM_ARROW_LIGHT); } this->unk_244 = 1; diff --git a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index 215d6400c..e50ba85d5 100644 --- a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -1108,7 +1108,7 @@ s32 EnZl4_CsMakePlan(EnZl4* this, PlayState* play) { Camera_ChangeSetting(GET_ACTIVE_CAM(play), 1); this->talkState = 7; play->talkWithPlayer(play, &this->actor); - if (GameInteractor_Should(VB_GIVE_ITEM_ZELDAS_LETTER, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_ZELDAS_LETTER, true)) { Actor_OfferGetItem(&this->actor, play, GI_LETTER_ZELDA, fabsf(this->actor.xzDistToPlayer) + 1.0f, fabsf(this->actor.yDistToPlayer) + 1.0f); } @@ -1117,7 +1117,7 @@ s32 EnZl4_CsMakePlan(EnZl4* this, PlayState* play) { } break; case 7: - if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_ZELDAS_LETTER, true, NULL)) { + if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_ZELDAS_LETTER, true)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_0); this->talkState++; } else { diff --git a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index cf83b730a..7a16f2a71 100644 --- a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -179,7 +179,7 @@ void ItemOcarina_WaitInWater(ItemOcarina* this, PlayState* play) { if ( Actor_HasParent(&this->actor, play) || ( - !GameInteractor_Should(VB_GIVE_ITEM_OCARINA_OF_TIME, true, NULL) && + !GameInteractor_Should(VB_GIVE_ITEM_OCARINA_OF_TIME, true) && (this->actor.xzDistToPlayer < 20.0f) && (fabsf(this->actor.yDistToPlayer) < 10.0f) && GET_PLAYER(play)->stateFlags2 & PLAYER_STATE2_DIVING ) @@ -189,7 +189,7 @@ void ItemOcarina_WaitInWater(ItemOcarina* this, PlayState* play) { this->actionFunc = ItemOcarina_StartSoTCutscene; this->actor.draw = NULL; } else { - if (GameInteractor_Should(VB_GIVE_ITEM_OCARINA_OF_TIME, true, NULL)) { + if (GameInteractor_Should(VB_GIVE_ITEM_OCARINA_OF_TIME, true)) { Actor_OfferGetItem(&this->actor, play, GI_OCARINA_OOT, 30.0f, 50.0f); } diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 0acf4f1f0..7efda7db2 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -4843,7 +4843,7 @@ s32 Player_ActionChange_1(Player* this, PlayState* play) { if ((this->doorType != PLAYER_DOORTYPE_NONE) && (!(this->stateFlags1 & PLAYER_STATE1_ITEM_OVER_HEAD) || ((this->heldActor != NULL) && (this->heldActor->id == ACTOR_EN_RU1)))) { - if ((CHECK_BTN_ALL(sControlInput->press.button, BTN_A) || (Player_Action_8084F9A0 == this->actionFunc)) && GameInteractor_Should(VB_BE_ABLE_TO_OPEN_DOORS, true, NULL)) { + if ((CHECK_BTN_ALL(sControlInput->press.button, BTN_A) || (Player_Action_8084F9A0 == this->actionFunc)) && GameInteractor_Should(VB_BE_ABLE_TO_OPEN_DOORS, true)) { doorActor = this->doorActor; if (this->doorType <= PLAYER_DOORTYPE_AJAR) { @@ -8515,7 +8515,7 @@ void func_80842A88(PlayState* play, Player* this) { s32 func_80842AC4(PlayState* play, Player* this) { if ((this->heldItemAction == PLAYER_IA_DEKU_STICK) && (this->unk_85C > 0.5f)) { - if (GameInteractor_Should(VB_DEKU_STICK_BREAK, AMMO(ITEM_STICK) != 0, NULL)) { + if (GameInteractor_Should(VB_DEKU_STICK_BREAK, AMMO(ITEM_STICK) != 0)) { EffectSsStick_Spawn(play, &this->bodyPartsPos[PLAYER_BODYPART_R_HAND], this->actor.shape.rot.y + 0x8000); this->unk_85C = 0.5f; @@ -10229,7 +10229,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { if ((sp50 == 0) || (sp50 < -1)) { titleFileSize = scene->titleFile.vromEnd - scene->titleFile.vromStart; - if (GameInteractor_Should(VB_SHOW_TITLE_CARD, gSaveContext.showTitleCard, NULL)) { + if (GameInteractor_Should(VB_SHOW_TITLE_CARD, gSaveContext.showTitleCard)) { if ((gSaveContext.sceneSetupIndex < 4) && (gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneSetupIndex)].field & ENTRANCE_INFO_DISPLAY_TITLE_CARD_FLAG) && @@ -10935,21 +10935,21 @@ static Color_RGBA8 D_808547C0 = { 255, 50, 0, 0 }; void Player_UpdateBurningDekuStick(PlayState* play, Player* this) { f32 temp; - if (GameInteractor_Should(VB_DEKU_STICK_BURN_OUT, this->unk_85C == 0.0f, NULL)) { + if (GameInteractor_Should(VB_DEKU_STICK_BURN_OUT, this->unk_85C == 0.0f)) { Player_UseItem(play, this, ITEM_NONE); return; } temp = 1.0f; uint8_t vanillaShouldBurnOutCondition = DECR(this->unk_860) == 0; - if (GameInteractor_Should(VB_DEKU_STICK_BURN_OUT, vanillaShouldBurnOutCondition, NULL)) { + if (GameInteractor_Should(VB_DEKU_STICK_BURN_OUT, vanillaShouldBurnOutCondition)) { Inventory_ChangeAmmo(ITEM_STICK, -1); this->unk_860 = 1; temp = 0.0f; this->unk_85C = temp; } else if (this->unk_860 > 200) { temp = (210 - this->unk_860) / 10.0f; - } else if (GameInteractor_Should(VB_DEKU_STICK_BURN_DOWN, this->unk_860 < 20, NULL)) { + } else if (GameInteractor_Should(VB_DEKU_STICK_BURN_DOWN, this->unk_860 < 20)) { temp = this->unk_860 / 20.0f; this->unk_85C = temp; } @@ -11251,7 +11251,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { func_80836BEC(this, play); if (this->heldItemAction == PLAYER_IA_DEKU_STICK && - GameInteractor_Should(VB_DEKU_STICK_BE_ON_FIRE, this->unk_860 != 0, NULL)) { + GameInteractor_Should(VB_DEKU_STICK_BE_ON_FIRE, this->unk_860 != 0)) { Player_UpdateBurningDekuStick(play, this); } else if ((this->heldItemAction == PLAYER_IA_FISHING_POLE) && (this->unk_860 < 0)) { this->unk_860++; @@ -13533,7 +13533,7 @@ s32 func_8084DFF4(PlayState* play, Player* this) { play->msgCtx.msgMode = MSGMODE_TEXT_DONE; } else { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { - if (GameInteractor_Should(VB_PLAY_NABOORU_CAPTURED_CS, this->getItemId == GI_GAUNTLETS_SILVER, NULL)) { + if (GameInteractor_Should(VB_PLAY_NABOORU_CAPTURED_CS, this->getItemId == GI_GAUNTLETS_SILVER)) { play->nextEntranceIndex = ENTR_DESERT_COLOSSUS_0; play->transitionTrigger = TRANS_TRIGGER_START; gSaveContext.nextCutsceneIndex = 0xFFF1; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index 9c4224181..b91696fad 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -14,7 +14,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { } else if (CVarGetInteger(CVAR_COSMETIC("DefaultColorScheme"), COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) { aButtonColor = (Color_RGB8){ 80, 255, 150 }; } - if (!GameInteractor_Should(VB_HAVE_OCARINA_NOTE_D4, true, NULL)) { + if (!GameInteractor_Should(VB_HAVE_OCARINA_NOTE_D4, true)) { aButtonColor = (Color_RGB8){ 191, 191, 191 }; } @@ -26,7 +26,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { if (CVarGetInteger(CVAR_COSMETIC("HUD.CUpButton.Changed"), 0)) { cUpButtonColor = CVarGetColor24(CVAR_COSMETIC("HUD.CUpButton.Value"), cUpButtonColor); } - if (!GameInteractor_Should(VB_HAVE_OCARINA_NOTE_D5, true, NULL)) { + if (!GameInteractor_Should(VB_HAVE_OCARINA_NOTE_D5, true)) { cUpButtonColor = (Color_RGB8){ 191, 191, 191 }; } @@ -34,7 +34,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { if (CVarGetInteger(CVAR_COSMETIC("HUD.CDownButton.Changed"), 0)) { cDownButtonColor = CVarGetColor24(CVAR_COSMETIC("HUD.CDownButton.Value"), cDownButtonColor); } - if (!GameInteractor_Should(VB_HAVE_OCARINA_NOTE_F4, true, NULL)) { + if (!GameInteractor_Should(VB_HAVE_OCARINA_NOTE_F4, true)) { cDownButtonColor = (Color_RGB8){ 191, 191, 191 }; } @@ -42,7 +42,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { if (CVarGetInteger(CVAR_COSMETIC("HUD.CLeftButton.Changed"), 0)) { cLeftButtonColor = CVarGetColor24(CVAR_COSMETIC("HUD.CLeftButton.Value"), cLeftButtonColor); } - if (!GameInteractor_Should(VB_HAVE_OCARINA_NOTE_B4, true, NULL)) { + if (!GameInteractor_Should(VB_HAVE_OCARINA_NOTE_B4, true)) { cLeftButtonColor = (Color_RGB8){ 191, 191, 191 }; } @@ -50,7 +50,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { if (CVarGetInteger(CVAR_COSMETIC("HUD.CRightButton.Changed"), 0)) { cRightButtonColor = CVarGetColor24(CVAR_COSMETIC("HUD.CRightButton.Value"), cRightButtonColor); } - if (!GameInteractor_Should(VB_HAVE_OCARINA_NOTE_A4, true, NULL)) { + if (!GameInteractor_Should(VB_HAVE_OCARINA_NOTE_A4, true)) { cRightButtonColor = (Color_RGB8){ 191, 191, 191 }; } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 1902781e5..48b25325b 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -3998,7 +3998,7 @@ void KaleidoScope_Update(PlayState* play) case 6: switch (pauseCtx->unk_1E4) { case 0: - if (GameInteractor_Should(VB_CLOSE_PAUSE_MENU, CHECK_BTN_ALL(input->press.button, BTN_START), NULL)) { + if (GameInteractor_Should(VB_CLOSE_PAUSE_MENU, CHECK_BTN_ALL(input->press.button, BTN_START))) { if (CVarGetInteger(CVAR_CHEAT("EasyPauseBuffer"), 0) || CVarGetInteger(CVAR_CHEAT("EasyInputBuffer"), 0)) { // Easy pause buffer is 13 frames, 12 for kaledio to end, and one more to advance a single frame CVarSetInteger(CVAR_GENERAL("CheatEasyPauseBufferTimer"), 13); @@ -4431,7 +4431,7 @@ void KaleidoScope_Update(PlayState* play) case 0x10: if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_START)) { - if (pauseCtx->promptChoice == 0 && GameInteractor_Should(VB_BE_ABLE_TO_SAVE, true, NULL)) { + if (pauseCtx->promptChoice == 0 && GameInteractor_Should(VB_BE_ABLE_TO_SAVE, true)) { Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); Play_SaveSceneFlags(play); @@ -4504,7 +4504,7 @@ void KaleidoScope_Update(PlayState* play) R_PAUSE_MENU_MODE = 0; func_800981B8(&play->objectCtx); func_800418D0(&play->colCtx, play); - if (pauseCtx->promptChoice == 0 && GameInteractor_Should(VB_BE_ABLE_TO_SAVE, true, NULL)) { + if (pauseCtx->promptChoice == 0 && GameInteractor_Should(VB_BE_ABLE_TO_SAVE, true)) { Play_TriggerRespawn(play); gSaveContext.respawnFlag = -2; // In ER, handle death warp to last entrance from grottos