From 0f390cfd7e3df3a62d820a0f9376ba66bbcd8a8b Mon Sep 17 00:00:00 2001 From: Pablo <72659707+Pepe20129@users.noreply.github.com> Date: Fri, 13 Dec 2024 22:58:51 +0100 Subject: [PATCH] Cleanup --- .../actors/ovl_player_actor/z_player.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 4bb995af37..9f284beb51 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -302,7 +302,7 @@ void Player_Action_TimeTravelEnd(Player* this, PlayState* play); void Player_Action_DrinkFromBottle(Player* this, PlayState* play); void Player_Action_SwingBottle(Player* this, PlayState* play); void Player_Action_UseFairyFromBottle(Player* this, PlayState* play); -void Player_Action_DropFromBottle(Player* this, PlayState* play); +void Player_Action_DropActorFromBottle(Player* this, PlayState* play); void Player_Action_ExchangeItem(Player* this, PlayState* play); void Player_Action_SlideOnSlope(Player* this, PlayState* play); void Player_Action_WaitForCutscene(Player* this, PlayState* play); @@ -6082,13 +6082,14 @@ s32 Player_ActionHandler_13(Player* this, PlayState* play) { } sp2C = Player_ActionToBottle(this, this->itemAction); - if (sp2C >= 0) { - if (sp2C == 0xC) { + #define ACTION_TO_BOTTLE_ACTION(action) (action - PLAYER_IA_BOTTLE) + if (sp2C >= ACTION_TO_BOTTLE_ACTION(PLAYER_IA_BOTTLE)) { + if (sp2C == ACTION_TO_BOTTLE_ACTION(PLAYER_IA_BOTTLE_FAIRY)) { Player_SetupActionPreserveItemAction(play, this, Player_Action_UseFairyFromBottle, 0); Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_bottle_bug_out); func_80835EA4(play, 3); - } else if ((sp2C > 0) && (sp2C < 4)) { - Player_SetupActionPreserveItemAction(play, this, Player_Action_DropFromBottle, 0); + } else if ((sp2C >= ACTION_TO_BOTTLE_ACTION(PLAYER_IA_BOTTLE_FISH)) && (sp2C <= ACTION_TO_BOTTLE_ACTION(PLAYER_IA_BOTTLE_BUG))) { + Player_SetupActionPreserveItemAction(play, this, Player_Action_DropActorFromBottle, 0); Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_bottle_fish_out); func_80835EA4(play, (sp2C == 1) ? 1 : 5); } else { @@ -14140,10 +14141,7 @@ typedef struct BottleDropInfo { /* 0x02 */ s16 actorParams; } BottleDropInfo; // size = 0x04 -/** - * Drops an actor (fish, insects or blue fire) from a bottle. - */ -void Player_Action_DropFromBottle(Player* this, PlayState* play) { +void Player_Action_DropActorFromBottle(Player* this, PlayState* play) { Player_DecelerateToZero(this); if (LinkAnimation_Update(play, &this->skelAnime)) { @@ -16070,7 +16068,7 @@ void Player_Action_CsAction(Player* this, PlayState* play) { int Player_IsDroppingFish(PlayState* play) { Player* this = GET_PLAYER(play); - return (Player_Action_DropFromBottle == this->actionFunc) && (this->itemAction == PLAYER_IA_BOTTLE_FISH); + return (Player_Action_DropActorFromBottle == this->actionFunc) && (this->itemAction == PLAYER_IA_BOTTLE_FISH); } s32 Player_StartFishing(PlayState* play) {