From 29cecd8502d3a5d7a60c41dd5a9ccec616017bef Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sun, 9 Feb 2025 08:49:56 -0800 Subject: [PATCH] fix dark link softlock (#5027) --- soh/soh/Enhancements/AssignableTunicsAndBoots.cpp | 13 +++++++++++-- .../vanilla-behavior/GIVanillaBehavior.h | 1 + soh/src/overlays/actors/ovl_player_actor/z_player.c | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp b/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp index a7e210b95..3a52312c9 100644 --- a/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp +++ b/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp @@ -94,10 +94,19 @@ void RegisterAssignableTunicsBoots() { return; } - Input* input = va_arg(args, Input*); - Player* player = GET_PLAYER(gPlayState); + Player* player = va_arg(args, Player*); + + // if we're not dealing with the actual player, we're probably + // dealing with dark link, don't do any tunics/boots stuff, just + // run the vanilla action func + if (player->actor.id != ACTOR_PLAYER) { + return; + } *should = false; + + Input* input = va_arg(args, Input*); + player->actionFunc(player, gPlayState); UseTunicBoots(player, gPlayState, input); }); diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 4974baf5b..56679f976 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -398,6 +398,7 @@ typedef enum { // !(this->stateFlags3 & PLAYER_STATE3_PAUSE_ACTION_FUNC) // ``` // #### `args` + // - `*Player` // - `*Input` VB_EXECUTE_PLAYER_ACTION_FUNC, 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 8141a8942..3db05d94e 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12166,7 +12166,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { sUseHeldItem = sHeldItemButtonIsHeldDown = 0; sSavedCurrentMask = this->currentMask; - if (GameInteractor_Should(VB_EXECUTE_PLAYER_ACTION_FUNC, !(this->stateFlags3 & PLAYER_STATE3_PAUSE_ACTION_FUNC), input)) { + if (GameInteractor_Should(VB_EXECUTE_PLAYER_ACTION_FUNC, !(this->stateFlags3 & PLAYER_STATE3_PAUSE_ACTION_FUNC), this, input)) { this->actionFunc(this, play); }