1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-09 18:43:45 +00:00

Address review

This commit is contained in:
Pablo 2024-12-26 21:32:31 +01:00
parent 24c974661e
commit 1cc97faf19
3 changed files with 10 additions and 8 deletions

View file

@ -181,6 +181,8 @@ typedef enum PlayerItemAction {
/* 0x43 */ PLAYER_IA_MAX
} PlayerItemAction;
#define ACTION_TO_BOTTLE(action) (action - PLAYER_IA_BOTTLE)
typedef enum PlayerLimb {
/* 0x00 */ PLAYER_LIMB_NONE,
/* 0x01 */ PLAYER_LIMB_ROOT,
@ -927,7 +929,7 @@ typedef struct Player {
s16 csDelayTimer; // Player_Action_WaitForCutscene: Number of frames to wait before responding to a cutscene
s16 playedLandingSfx; // Player_Action_BlueWarpArrive: Played sfx when landing on the ground
s16 appearTimer; // Player_Action_FaroresWindArrive: Counts up, appear at 20 frames (1 second)
s16 drinkingState; // Player_Action_DrinkFromBottle: Uses values 0-2 to determine which part of the drinking action is currently active
s16 drinkingState; // Player_Action_DrinkFromBottle: Uses values 0-2 to determine which part of the drinking action is currently active (see DrinkingState enum)
} av2; // "Action Variable 2": context dependent variable that has different meanings depending on what action is currently running
/* 0x0854 */ f32 unk_854;

View file

@ -880,9 +880,9 @@ int Player_HoldsBrokenKnife(Player* this) {
}
s32 Player_ActionToBottle(Player* this, s32 itemAction) {
s32 bottle = itemAction - PLAYER_IA_BOTTLE;
s32 bottle = ACTION_TO_BOTTLE(itemAction);
if ((bottle >= 0) && (bottle < 13)) {
if ((bottle >= ACTION_TO_BOTTLE(PLAYER_IA_BOTTLE)) && (bottle <= ACTION_TO_BOTTLE(PLAYER_IA_BOTTLE_FAIRY))) {
return bottle;
} else {
return -1;

View file

@ -6082,14 +6082,14 @@ s32 Player_ActionHandler_13(Player* this, PlayState* play) {
}
sp2C = Player_ActionToBottle(this, this->itemAction);
#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)) {
if (sp2C >= ACTION_TO_BOTTLE(PLAYER_IA_BOTTLE)) {
if (sp2C == ACTION_TO_BOTTLE(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 >= ACTION_TO_BOTTLE_ACTION(PLAYER_IA_BOTTLE_FISH)) &&
(sp2C <= ACTION_TO_BOTTLE_ACTION(PLAYER_IA_BOTTLE_BUG))) {
} else if ((sp2C >= ACTION_TO_BOTTLE(PLAYER_IA_BOTTLE_FISH)) &&
(sp2C <= ACTION_TO_BOTTLE(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);