diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 39e9156956..7519787dea 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -5239,6 +5239,14 @@ void func_8083AF44(PlayState* play, Player* this, s32 magicSpell) { func_80835DE4(play, this, Player_Action_808507F4, 0); this->actionVar1 = magicSpell - 3; + + //! @bug `MAGIC_CONSUME_WAIT_PREVIEW` is not guaranteed to succeed. + //! Ideally, the return value of `Magic_RequestChange` should be checked before allowing the process of + //! using a spell to continue. If the magic state change request fails, `gSaveContext.magicTarget` will + //! never be set correctly. + //! When `MAGIC_STATE_CONSUME_SETUP` is set in `Player_Action_808507F4`, magic will eventually be + //! consumed to a stale target value. If that stale target value is higher than the current + //! magic value, it will be consumed to zero. Magic_RequestChange(play, sMagicSpellCosts[magicSpell], MAGIC_CONSUME_WAIT_PREVIEW); LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, &gPlayerAnim_link_magic_tame, 0.83f);