From 63f7d07b3925eda9b8e7a6a692b691f919d643ed Mon Sep 17 00:00:00 2001 From: inspectredc <78732756+inspectredc@users.noreply.github.com> Date: Wed, 17 Jan 2024 17:54:18 +0000 Subject: [PATCH] Fix DoActions on B (mac) (#66) * fix doaction on B mac * add comment --- mm/include/z64interface.h | 3 ++- mm/src/overlays/actors/ovl_player_actor/z_player.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/include/z64interface.h b/mm/include/z64interface.h index d6b65f96b..abc508587 100644 --- a/mm/include/z64interface.h +++ b/mm/include/z64interface.h @@ -23,7 +23,8 @@ typedef enum { } AButtonState; typedef enum { - /* 0x00 */ DO_ACTION_ATTACK, + /* -1 */ DO_ACTION_UNDEFINED = -1, // #Region [2s2h] DO_ACTION_UNDEFINED added so comparisons between the enum type and -1 would work on all systems + /* 0x00 */ DO_ACTION_ATTACK = 0, /* 0x01 */ DO_ACTION_CHECK, /* 0x02 */ DO_ACTION_ENTER, /* 0x03 */ DO_ACTION_RETURN, diff --git a/mm/src/overlays/actors/ovl_player_actor/z_player.c b/mm/src/overlays/actors/ovl_player_actor/z_player.c index 58fae4539..8dd790223 100644 --- a/mm/src/overlays/actors/ovl_player_actor/z_player.c +++ b/mm/src/overlays/actors/ovl_player_actor/z_player.c @@ -10955,7 +10955,7 @@ void Player_SetDoAction(PlayState* play, Player* this) { return; } - doActionB = -1; + doActionB = DO_ACTION_UNDEFINED; sp38 = func_801242B4(this) || (Player_Action_28 == this->actionFunc); // Set B do action @@ -10986,7 +10986,7 @@ void Player_SetDoAction(PlayState* play, Player* this) { } } - if (doActionB > -1) { + if (doActionB > DO_ACTION_UNDEFINED) { Interface_SetBButtonDoAction(play, doActionB); } else if (play->interfaceCtx.bButtonDoActionActive) { play->interfaceCtx.bButtonDoActionActive = false;