From 900c2f0f686fc391a50d24f391d7a1cb4e2ed614 Mon Sep 17 00:00:00 2001 From: fig02 Date: Sun, 8 Sep 2024 17:43:27 -0400 Subject: [PATCH] Name `PLAYER_STATE1_ACTOR_CARRY` (#2173) * actor carry flag * format and add comments * comment changes --- include/z64player.h | 10 +-- src/code/z_actor.c | 6 +- src/code/z_camera.c | 2 +- src/code/z_player_lib.c | 2 +- .../z_bg_spot16_bombstone.c | 2 +- .../actors/ovl_Door_Shutter/z_door_shutter.c | 2 +- src/overlays/actors/ovl_En_Bom/z_en_bom.c | 4 +- src/overlays/actors/ovl_En_Bombf/z_en_bombf.c | 10 +-- .../actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c | 2 +- src/overlays/actors/ovl_En_Ta/z_en_ta.c | 4 +- .../actors/ovl_player_actor/z_player.c | 88 ++++++++++--------- 11 files changed, 67 insertions(+), 65 deletions(-) diff --git a/include/z64player.h b/include/z64player.h index 248b3bdfec..5fc1eca57e 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -649,17 +649,17 @@ typedef struct WeaponInfo { #define LEDGE_DIST_MAX 399.96002f #define PLAYER_STATE1_0 (1 << 0) -#define PLAYER_STATE1_SWINGING_BOTTLE (1 << 1) +#define PLAYER_STATE1_SWINGING_BOTTLE (1 << 1) // Bottle is swung; Bottle is active and can catch things #define PLAYER_STATE1_2 (1 << 2) #define PLAYER_STATE1_3 (1 << 3) #define PLAYER_STATE1_4 (1 << 4) #define PLAYER_STATE1_5 (1 << 5) #define PLAYER_STATE1_6 (1 << 6) #define PLAYER_STATE1_7 (1 << 7) -#define PLAYER_STATE1_START_CHANGING_HELD_ITEM (1 << 8) +#define PLAYER_STATE1_START_CHANGING_HELD_ITEM (1 << 8) // Item change process has begun #define PLAYER_STATE1_9 (1 << 9) #define PLAYER_STATE1_10 (1 << 10) -#define PLAYER_STATE1_11 (1 << 11) +#define PLAYER_STATE1_ACTOR_CARRY (1 << 11) // Currently carrying an actor #define PLAYER_STATE1_12 (1 << 12) #define PLAYER_STATE1_13 (1 << 13) #define PLAYER_STATE1_14 (1 << 14) @@ -690,14 +690,14 @@ typedef struct WeaponInfo { #define PLAYER_STATE2_6 (1 << 6) #define PLAYER_STATE2_7 (1 << 7) #define PLAYER_STATE2_8 (1 << 8) -#define PLAYER_STATE2_FORCE_SAND_FLOOR_SOUND (1 << 9) +#define PLAYER_STATE2_FORCE_SAND_FLOOR_SOUND (1 << 9) // Forces sand footstep sounds regardless of current floor type #define PLAYER_STATE2_10 (1 << 10) #define PLAYER_STATE2_11 (1 << 11) #define PLAYER_STATE2_12 (1 << 12) #define PLAYER_STATE2_13 (1 << 13) #define PLAYER_STATE2_14 (1 << 14) #define PLAYER_STATE2_15 (1 << 15) -#define PLAYER_STATE2_DO_ACTION_ENTER (1 << 16) // Turns on the "Enter On A" DoAction +#define PLAYER_STATE2_DO_ACTION_ENTER (1 << 16) // Sets the "Enter On A" DoAction #define PLAYER_STATE2_17 (1 << 17) #define PLAYER_STATE2_CRAWLING (1 << 18) // Crawling through a crawlspace #define PLAYER_STATE2_19 (1 << 19) diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 8e1e39f78d..3469ee567c 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1103,7 +1103,7 @@ int func_8002DD78(Player* player) { int func_8002DDA8(PlayState* play) { Player* player = GET_PLAYER(play); - return (player->stateFlags1 & PLAYER_STATE1_11) || func_8002DD78(player); + return (player->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) || func_8002DD78(player); } s32 func_8002DDE4(PlayState* play) { @@ -1811,7 +1811,7 @@ s32 Actor_OfferGetItem(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange Player_GetExplosiveHeld(player) < 0) { if ((((player->heldActor != NULL) || (actor == player->talkActor)) && (getItemId > GI_NONE) && (getItemId < GI_MAX)) || - (!(player->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_29)))) { + (!(player->stateFlags1 & (PLAYER_STATE1_ACTOR_CARRY | PLAYER_STATE1_29)))) { if ((actor->xzDistToPlayer < xzRange) && (fabsf(actor->yDistToPlayer) < yRange)) { s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y; s32 absYawDiff = ABS(yawDiff); @@ -1880,7 +1880,7 @@ u32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide) { Player* player = GET_PLAYER(play); if (!(player->stateFlags1 & - (PLAYER_STATE1_7 | PLAYER_STATE1_11 | PLAYER_STATE1_12 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | + (PLAYER_STATE1_7 | PLAYER_STATE1_ACTOR_CARRY | PLAYER_STATE1_12 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_20 | PLAYER_STATE1_21))) { player->rideActor = horse; player->mountSide = mountSide; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 41210ff4e4..ce22019150 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -6607,7 +6607,7 @@ s32 Camera_Demo5(Camera* camera) { sp4A = playerhead.rot.y - playerTargetGeo.yaw; if (camera->target->category == ACTORCAT_PLAYER) { framesDiff = camera->play->state.frames - sDemo5PrevAction12Frame; - if (player->stateFlags1 & PLAYER_STATE1_11) { + if (player->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) { // holding object over head. Player_SetCsActionWithHaltedActors(camera->play, camera->target, PLAYER_CSACTION_8); } else if (ABS(framesDiff) > 3000) { diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 1eeaf0d206..b75a8a7581 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1552,7 +1552,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve Matrix_Get(&sp14C); Matrix_MtxFToYXZRotS(&sp14C, &hookedActor->world.rot, 0); hookedActor->shape.rot = hookedActor->world.rot; - } else if (this->stateFlags1 & PLAYER_STATE1_11) { + } else if (this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) { Vec3s spB8; Matrix_Get(&sp14C); diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index ced99d7824..8e459f8d84 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -416,7 +416,7 @@ void func_808B57E0(BgSpot16Bombstone* this, PlayState* play) { OnePointCutscene_Init(play, 4180, sTimer, NULL, CAM_ID_MAIN); } } - } else if (player->stateFlags1 & PLAYER_STATE1_11) { + } else if (player->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) { playerHeldActor = player->heldActor; if (playerHeldActor != NULL && playerHeldActor->category == ACTORCAT_EXPLOSIVE && playerHeldActor->id == ACTOR_EN_BOMBF) { diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 64be9c8321..5ddf5f572e 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -816,7 +816,7 @@ void DoorShutter_SetupClosed(DoorShutter* this, PlayState* play) { } this->isActive = false; this->dyna.actor.velocity.y = 0.0f; - if (DoorShutter_SetupDoor(this, play) && !(player->stateFlags1 & PLAYER_STATE1_11)) { + if (DoorShutter_SetupDoor(this, play) && !(player->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY)) { // The door is barred behind the player DoorShutter_SetupAction(this, DoorShutter_WaitPlayerSurprised); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_2); diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index 6aba2ef11a..2b4b8f6a2c 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -207,11 +207,11 @@ void EnBom_Explode(EnBom* this, PlayState* play) { if (this->timer == 0) { player = GET_PLAYER(play); - if ((player->stateFlags1 & PLAYER_STATE1_11) && (player->heldActor == &this->actor)) { + if ((player->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) && (player->heldActor == &this->actor)) { player->actor.child = NULL; player->heldActor = NULL; player->interactRangeActor = NULL; - player->stateFlags1 &= ~PLAYER_STATE1_11; + player->stateFlags1 &= ~PLAYER_STATE1_ACTOR_CARRY; } Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index 2eb859805b..89e4157a4f 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -163,7 +163,7 @@ void EnBombf_GrowBomb(EnBombf* this, PlayState* play) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~PLAYER_STATE1_11; + player->stateFlags1 &= ~PLAYER_STATE1_ACTOR_CARRY; } } else if (this->bombCollider.base.acFlags & AC_HIT) { this->bombCollider.base.acFlags &= ~AC_HIT; @@ -197,7 +197,7 @@ void EnBombf_GrowBomb(EnBombf* this, PlayState* play) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~PLAYER_STATE1_11; + player->stateFlags1 &= ~PLAYER_STATE1_ACTOR_CARRY; this->actor.world.pos = this->actor.home.pos; } } @@ -215,7 +215,7 @@ void EnBombf_GrowBomb(EnBombf* this, PlayState* play) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~PLAYER_STATE1_11; + player->stateFlags1 &= ~PLAYER_STATE1_ACTOR_CARRY; this->actor.world.pos = this->actor.home.pos; } } @@ -299,11 +299,11 @@ void EnBombf_Explode(EnBombf* this, PlayState* play) { if (this->timer == 0) { player = GET_PLAYER(play); - if ((player->stateFlags1 & PLAYER_STATE1_11) && (player->heldActor == &this->actor)) { + if ((player->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) && (player->heldActor == &this->actor)) { player->actor.child = NULL; player->heldActor = NULL; player->interactRangeActor = NULL; - player->stateFlags1 &= ~PLAYER_STATE1_11; + player->stateFlags1 &= ~PLAYER_STATE1_ACTOR_CARRY; } Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index ac1b1e91db..dd34c42a2d 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -116,7 +116,7 @@ void EnDntJiji_Wait(EnDntJiji* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if ((this->timer == 1) && (this->actor.xzDistToPlayer < 150.0f) && !Play_InCsMode(play) && - !(player->stateFlags1 & PLAYER_STATE1_11)) { + !(player->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY)) { OnePointCutscene_Init(play, 2230, -99, &this->actor, CAM_ID_MAIN); this->timer = 0; Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 17eb0b3b3a..45e449992f 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -622,7 +622,7 @@ s32 EnTa_IsPlayerHoldingSuperCucco(EnTa* this, PlayState* play, s32 cuccoIdx) { Player* player = GET_PLAYER(play); Actor* interactRangeActor; - if (player->stateFlags1 & PLAYER_STATE1_11) { + if (player->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) { interactRangeActor = player->interactRangeActor; if (interactRangeActor != NULL && interactRangeActor->id == ACTOR_EN_NIW && interactRangeActor == &this->superCuccos[cuccoIdx]->actor) { @@ -658,7 +658,7 @@ void EnTa_TalkFoundSuperCucco(EnTa* this, PlayState* play) { if (player->heldActor == &this->superCuccos[lastFoundSuperCuccoIdx]->actor) { player->heldActor = NULL; } - player->stateFlags1 &= ~PLAYER_STATE1_11; + player->stateFlags1 &= ~PLAYER_STATE1_ACTOR_CARRY; this->superCuccos[lastFoundSuperCuccoIdx] = NULL; } this->stateFlags |= TALON_STATE_FLAG_TRACKING_PLAYER; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 0a82afeed2..460f69884f 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -1682,7 +1682,7 @@ void Player_DetachHeldActor(PlayState* play, Player* this) { this->heldActor = NULL; this->interactRangeActor = NULL; heldActor->parent = NULL; - this->stateFlags1 &= ~PLAYER_STATE1_11; + this->stateFlags1 &= ~PLAYER_STATE1_ACTOR_CARRY; } if (Player_GetExplosiveHeld(this) >= 0) { @@ -1692,14 +1692,14 @@ void Player_DetachHeldActor(PlayState* play, Player* this) { } void func_80832440(PlayState* play, Player* this) { - if ((this->stateFlags1 & PLAYER_STATE1_11) && (this->heldActor == NULL)) { + if ((this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) && (this->heldActor == NULL)) { if (this->interactRangeActor != NULL) { if (this->getItemId == GI_NONE) { - this->stateFlags1 &= ~PLAYER_STATE1_11; + this->stateFlags1 &= ~PLAYER_STATE1_ACTOR_CARRY; this->interactRangeActor = NULL; } } else { - this->stateFlags1 &= ~PLAYER_STATE1_11; + this->stateFlags1 &= ~PLAYER_STATE1_ACTOR_CARRY; } } @@ -2220,7 +2220,7 @@ void Player_InitExplosiveIA(PlayState* play, Player* this) { ExplosiveInfo* explosiveInfo; Actor* spawnedActor; - if (this->stateFlags1 & PLAYER_STATE1_11) { + if (this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) { Player_PutAwayHeldItem(play, this); return; } @@ -2245,7 +2245,7 @@ void Player_InitExplosiveIA(PlayState* play, Player* this) { this->heldActor = spawnedActor; this->getItemId = GI_NONE; this->unk_3BC.y = spawnedActor->shape.rot.y - this->actor.shape.rot.y; - this->stateFlags1 |= PLAYER_STATE1_11; + this->stateFlags1 |= PLAYER_STATE1_ACTOR_CARRY; } } @@ -2406,7 +2406,7 @@ void Player_ProcessItemButtons(Player* this, PlayState* play) { } } - if (!(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_29)) && !func_8008F128(this)) { + if (!(this->stateFlags1 & (PLAYER_STATE1_ACTOR_CARRY | PLAYER_STATE1_29)) && !func_8008F128(this)) { if (this->itemAction >= PLAYER_IA_FISHING_POLE) { if (!Player_ItemIsInUse(this, B_BTN_ITEM) && !Player_ItemIsInUse(this, C_BTN_ITEM(0)) && !Player_ItemIsInUse(this, C_BTN_ITEM(1)) && !Player_ItemIsInUse(this, C_BTN_ITEM(2))) { @@ -3023,7 +3023,7 @@ s32 Player_UpperAction_CarryActor(Player* this, PlayState* play) { return true; } - if (this->stateFlags1 & PLAYER_STATE1_11) { + if (this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) { if (LinkAnimation_Update(play, &this->upperSkelAnime)) { LinkAnimation_PlayLoop(play, &this->upperSkelAnime, &gPlayerAnim_link_normal_carryB_wait); } @@ -3164,7 +3164,7 @@ s32 Player_SetupAction(PlayState* play, Player* this, PlayerActionFunc actionFun func_8008EC70(this); } - if (!(flags & 1) && !(this->stateFlags1 & PLAYER_STATE1_11)) { + if (!(flags & 1) && !(this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY)) { func_80834644(play, this); this->stateFlags1 &= ~PLAYER_STATE1_22; } @@ -3629,7 +3629,7 @@ void func_80836BEC(Player* this, PlayState* play) { if (this->focusActor != NULL) { this->stateFlags1 &= ~(PLAYER_STATE1_16 | PLAYER_STATE1_PARALLEL); - if ((this->stateFlags1 & PLAYER_STATE1_11) || + if ((this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) || !CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) { this->stateFlags1 |= PLAYER_STATE1_16; } @@ -4584,7 +4584,7 @@ s32 Player_ActionChange_12(Player* this, PlayState* play) { f32 sp34; f32 temp; - if (!(this->stateFlags1 & PLAYER_STATE1_11) && (this->ledgeClimbType >= PLAYER_LEDGE_CLIMB_2) && + if (!(this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) && (this->ledgeClimbType >= PLAYER_LEDGE_CLIMB_2) && (!(this->stateFlags1 & PLAYER_STATE1_27) || (this->ageProperties->unk_14 > this->yDistToLedge))) { sp3C = 0; @@ -4958,7 +4958,7 @@ s32 Player_ActionChange_1(Player* this, PlayState* play) { s32 frontRoom; if ((this->doorType != PLAYER_DOORTYPE_NONE) && - (!(this->stateFlags1 & PLAYER_STATE1_11) || + (!(this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) || ((this->heldActor != NULL) && (this->heldActor->id == ACTOR_EN_RU1)))) { if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) || (Player_Action_8084F9A0 == this->actionFunc)) { doorActor = this->doorActor; @@ -5225,7 +5225,7 @@ void func_8083A0F4(PlayState* play, Player* this) { } } else { func_80839F90(this, play); - this->stateFlags1 &= ~PLAYER_STATE1_11; + this->stateFlags1 &= ~PLAYER_STATE1_ACTOR_CARRY; } } @@ -5444,7 +5444,7 @@ void func_8083AA10(Player* this, PlayState* play) { (sYDistToFloor > 20.0f) && (this->meleeWeaponState == 0) && (ABS(sp5C) < 0x2000) && (this->speedXZ > 3.0f)) { - if ((sPrevFloorProperty == FLOOR_PROPERTY_11) && !(this->stateFlags1 & PLAYER_STATE1_11)) { + if ((sPrevFloorProperty == FLOOR_PROPERTY_11) && !(this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY)) { sp40 = func_808396F4(play, this, &D_8085451C, &sp44, &sp58, &sp54); sp3C = this->actor.world.pos.y; @@ -5771,7 +5771,7 @@ s32 Player_ActionChange_4(Player* this, PlayState* play) { if ((sp34 != NULL) || (sp2C != NULL)) { if ((sp30 == NULL) || (sp30 == sp34) || (sp30 == sp2C)) { - if (!(this->stateFlags1 & PLAYER_STATE1_11) || + if (!(this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) || ((this->heldActor != NULL) && (sp28 || (sp34 == this->heldActor) || (sp2C == this->heldActor) || ((sp34 != NULL) && (sp34->flags & ACTOR_FLAG_16))))) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->stateFlags1 & PLAYER_STATE1_23) || @@ -5819,7 +5819,7 @@ s32 Player_ActionChange_4(Player* this, PlayState* play) { } s32 func_8083B8F4(Player* this, PlayState* play) { - if (!(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_23)) && + if (!(this->stateFlags1 & (PLAYER_STATE1_ACTOR_CARRY | PLAYER_STATE1_23)) && Camera_CheckValidMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_FIRST_PERSON)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (func_808332B8(this) && (this->actor.depthInWater < this->ageProperties->unk_2C))) { @@ -6391,7 +6391,7 @@ s32 func_8083D12C(PlayState* play, Player* this, Input* arg2) { Player_SetupAction(play, this, Player_Action_8084E1EC, 1); if (this->stateFlags1 & PLAYER_STATE1_10) { - this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_11 | PLAYER_STATE1_29; + this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_ACTOR_CARRY | PLAYER_STATE1_29; } this->av2.actionVar2 = 2; @@ -6399,7 +6399,7 @@ s32 func_8083D12C(PlayState* play, Player* this, Input* arg2) { func_80832340(play, this); Player_AnimChangeOnceMorph(play, this, - (this->stateFlags1 & PLAYER_STATE1_11) + (this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) ? &gPlayerAnim_link_swimer_swim_get : &gPlayerAnim_link_swimer_swim_deep_end); @@ -6859,7 +6859,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { func_80835EA4(play, 9); } - this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_11 | PLAYER_STATE1_29; + this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_ACTOR_CARRY | PLAYER_STATE1_29; func_80832224(this); return 1; } @@ -6867,8 +6867,8 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { func_8083E4C4(play, this, giEntry); this->getItemId = GI_NONE; } - } else if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && !(this->stateFlags1 & PLAYER_STATE1_11) && - !(this->stateFlags2 & PLAYER_STATE2_10)) { + } else if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && + !(this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) && !(this->stateFlags2 & PLAYER_STATE2_10)) { if (this->getItemId != GI_NONE) { GetItemEntry* giEntry = &sGetItemTable[-this->getItemId - 1]; EnBox* chest = (EnBox*)interactedActor; @@ -6882,7 +6882,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { } Player_SetupWaitForPutAway(play, this, func_8083A434); - this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_11 | PLAYER_STATE1_29; + this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_ACTOR_CARRY | PLAYER_STATE1_29; func_8083AE40(this, giEntry->objectId); this->actor.world.pos.x = chest->dyna.actor.world.pos.x - (Math_SinS(chest->dyna.actor.shape.rot.y) * 29.4343f); @@ -6935,7 +6935,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { } func_80832224(this); - this->stateFlags1 |= PLAYER_STATE1_11; + this->stateFlags1 |= PLAYER_STATE1_ACTOR_CARRY; return 1; } } @@ -6959,7 +6959,7 @@ s32 func_8083EAF0(Player* this, Actor* actor) { } s32 Player_ActionChange_9(Player* this, PlayState* play) { - if ((this->stateFlags1 & PLAYER_STATE1_11) && (this->heldActor != NULL) && + if ((this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) && (this->heldActor != NULL) && CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT)) { if (!func_80835644(play, this, this->heldActor)) { if (!func_8083EAF0(this, this->heldActor)) { @@ -7288,8 +7288,8 @@ void func_8083F72C(Player* this, LinkAnimationHeader* anim, PlayState* play) { s32 Player_ActionChange_5(Player* this, PlayState* play) { DynaPolyActor* wallPolyActor; - if (!(this->stateFlags1 & PLAYER_STATE1_11) && (this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && - (sShapeYawToTouchedWall < 0x3000)) { + if (!(this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) && + (this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && (sShapeYawToTouchedWall < 0x3000)) { if (((this->speedXZ > 0.0f) && func_8083EC18(this, play, sTouchedWallFlags)) || Player_TryEnteringCrawlspace(this, play, sTouchedWallFlags)) { @@ -7313,7 +7313,7 @@ s32 Player_ActionChange_5(Player* this, PlayState* play) { } Player_SetupWaitForPutAway(play, this, func_8083A0F4); - this->stateFlags1 |= PLAYER_STATE1_11; + this->stateFlags1 |= PLAYER_STATE1_ACTOR_CARRY; this->interactRangeActor = &wallPolyActor->actor; this->getItemId = GI_NONE; this->yaw = this->actor.wallYaw + 0x8000; @@ -7706,7 +7706,7 @@ void func_808409CC(PlayState* play, Player* this) { anim = func_80833338(this); } else { this->stateFlags2 |= PLAYER_STATE2_28; - if (this->stateFlags1 & PLAYER_STATE1_11) { + if (this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) { anim = func_80833338(this); } else { sp38 = play->roomCtx.curRoom.behaviorType2; @@ -8998,7 +8998,7 @@ void Player_Action_8084411C(Player* this, PlayState* play) { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Actor* heldActor; - if (this->stateFlags1 & PLAYER_STATE1_11) { + if (this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) { heldActor = this->heldActor; if (!func_80835644(play, this, heldActor) && (heldActor->id == ACTOR_EN_NIW) && @@ -9037,7 +9037,8 @@ void Player_Action_8084411C(Player* this, PlayState* play) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && !(this->stateFlags2 & PLAYER_STATE2_19) && - !(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_27)) && (this->speedXZ > 0.0f)) { + !(this->stateFlags1 & (PLAYER_STATE1_ACTOR_CARRY | PLAYER_STATE1_27)) && + (this->speedXZ > 0.0f)) { if ((this->yDistToLedge >= 150.0f) && (this->controlStickDirections[this->controlStickDataIndex] == PLAYER_STICK_DIR_FORWARD)) { func_8083EC18(this, play, sTouchedWallFlags); @@ -9079,7 +9080,7 @@ void Player_Action_8084411C(Player* this, PlayState* play) { anim = GET_PLAYER_ANIM(PLAYER_ANIMGROUP_short_landing, this->modelAnimType); } else if ((this->fallDistance < 800) && (this->controlStickDirections[this->controlStickDataIndex] == PLAYER_STICK_DIR_FORWARD) && - !(this->stateFlags1 & PLAYER_STATE1_11)) { + !(this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY)) { func_8083BC04(this, play); return; } @@ -9556,7 +9557,8 @@ void Player_Action_WaitForPutAway(Player* this, PlayState* play) { // The other conditions listed will force the put away delay function to run instantly if carrying an actor. // This is necessary because the UpperAction for carrying actors will always return true while holding // the actor, so `!Player_UpdateUpperBody` could never pass. - if (((this->stateFlags1 & PLAYER_STATE1_11) && (this->heldActor != NULL) && (this->getItemId == GI_NONE)) || + if (((this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) && (this->heldActor != NULL) && + (this->getItemId == GI_NONE)) || !Player_UpdateUpperBody(this, play)) { this->afterPutAwayFunc(play, this); } @@ -9684,7 +9686,7 @@ void Player_Action_80845CA4(Player* this, PlayState* play) { } } - if (this->stateFlags1 & PLAYER_STATE1_11) { + if (this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) { Player_UpdateUpperBody(this, play); } } @@ -9823,7 +9825,7 @@ void Player_Action_80846408(Player* this, PlayState* play) { this->av2.actionVar2--; if (this->av2.actionVar2 == 0) { func_8083A098(this, &gPlayerAnim_link_normal_nocarry_free_end, play); - this->stateFlags1 &= ~PLAYER_STATE1_11; + this->stateFlags1 &= ~PLAYER_STATE1_ACTOR_CARRY; Player_PlayVoiceSfx(this, NA_SE_VO_LI_DAMAGE_S); } } @@ -10286,10 +10288,10 @@ void Player_UpdateInterface(PlayState* play, Player* this) { } } else if ((Player_Action_8084E3C4 != this->actionFunc) && !(this->stateFlags2 & PLAYER_STATE2_CRAWLING)) { if ((this->doorType != PLAYER_DOORTYPE_NONE) && - (!(this->stateFlags1 & PLAYER_STATE1_11) || + (!(this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) || ((heldActor != NULL) && (heldActor->id == ACTOR_EN_RU1)))) { doAction = DO_ACTION_OPEN; - } else if ((!(this->stateFlags1 & PLAYER_STATE1_11) || (heldActor == NULL)) && + } else if ((!(this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) || (heldActor == NULL)) && (interactRangeActor != NULL) && ((!sp1C && (this->getItemId == GI_NONE)) || ((this->getItemId < 0) && !(this->stateFlags1 & PLAYER_STATE1_27)))) { @@ -10327,7 +10329,7 @@ void Player_UpdateInterface(PlayState* play, Player* this) { doAction = DO_ACTION_DOWN; } else if (this->stateFlags2 & PLAYER_STATE2_DO_ACTION_ENTER) { doAction = DO_ACTION_ENTER; - } else if ((this->stateFlags1 & PLAYER_STATE1_11) && (this->getItemId == GI_NONE) && + } else if ((this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) && (this->getItemId == GI_NONE) && (heldActor != NULL)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (heldActor->id == ACTOR_EN_NIW)) { if (func_8083EAF0(this, heldActor) == 0) { @@ -11377,7 +11379,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { this->exchangeItemId = EXCH_ITEM_NONE; } - if (!(this->stateFlags1 & PLAYER_STATE1_11)) { + if (!(this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY)) { this->interactRangeActor = NULL; this->getItemDirection = 0x6000; } @@ -13015,7 +13017,7 @@ void Player_Action_8084DC48(Player* this, PlayState* play) { } else if (!func_8083D12C(play, this, sControlInput)) { sp2C = (this->av2.actionVar2 * 0.018f) + 4.0f; - if (this->stateFlags1 & PLAYER_STATE1_11) { + if (this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY) { sControlInput = NULL; } @@ -13033,7 +13035,7 @@ void Player_Action_8084DC48(Player* this, PlayState* play) { void func_8084DF6C(PlayState* play, Player* this) { this->unk_862 = 0; - this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11); + this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_ACTOR_CARRY); this->getItemId = GI_NONE; Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN)); } @@ -13254,7 +13256,7 @@ void Player_Action_8084E6D4(Player* this, PlayState* play) { func_80832DBC(this); if (this->getItemId == GI_ICE_TRAP) { - this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11); + this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_ACTOR_CARRY); if (this->getItemId != GI_ICE_TRAP) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, @@ -14680,7 +14682,7 @@ void func_808514C0(PlayState* play, Player* this, CsCmdActorCue* cue) { LinkAnimation_Update(play, &this->skelAnime); - if (func_8008F128(this) || (this->stateFlags1 & PLAYER_STATE1_11)) { + if (func_8008F128(this) || (this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY)) { Player_UpdateUpperBody(this, play); return; } @@ -14729,7 +14731,7 @@ void func_80851688(PlayState* play, Player* this, CsCmdActorCue* cue) { LinkAnimation_Update(play, &this->skelAnime); - if (func_8008F128(this) || (this->stateFlags1 & PLAYER_STATE1_11)) { + if (func_8008F128(this) || (this->stateFlags1 & PLAYER_STATE1_ACTOR_CARRY)) { Player_UpdateUpperBody(this, play); } }