1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 09:45:02 +00:00

Document niche magic spell bug (#1526)

* document magic spell bug

* Update src/overlays/actors/ovl_player_actor/z_player.c

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* adjust comment

* fix renamed func and reformat

---------

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
fig02 2023-09-19 13:23:56 -04:00 committed by GitHub
parent 5170f2de17
commit 83a13a64c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);