diff --git a/include/z64player.h b/include/z64player.h index 6acf673364..c7b6ae48d5 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -795,7 +795,7 @@ typedef struct Player { /* 0x0498 */ ColliderCylinder cylinder; /* 0x04E4 */ ColliderQuad meleeWeaponQuads[2]; /* 0x05E4 */ ColliderQuad shieldQuad; - /* 0x0664 */ Actor* unk_664; + /* 0x0664 */ Actor* focusActor; // Actor that Player and the camera are looking at; Used for lock-on, talking, and more /* 0x0668 */ char unk_668[0x004]; /* 0x066C */ s32 unk_66C; /* 0x0670 */ s32 meleeWeaponEffectIndex; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 5bd46f49c8..599500770b 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -321,7 +321,7 @@ void Target_Init(TargetContext* targetCtx, Actor* actor, PlayState* play) { } void Target_Draw(TargetContext* targetCtx, PlayState* play) { - Actor* actor; // used for both the reticle and arrow + Actor* actor; // used for both the reticle actor and arrow hover actor actor = targetCtx->reticleActor; @@ -386,7 +386,7 @@ void Target_Draw(TargetContext* targetCtx, PlayState* play) { Target_SetReticlePos(targetCtx, targetCtx->curReticle, projectedPos.x, projectedPos.y, projectedPos.z); - if (!(player->stateFlags1 & PLAYER_STATE1_6) || (actor != player->unk_664)) { + if (!(player->stateFlags1 & PLAYER_STATE1_6) || (actor != player->focusActor)) { OVERLAY_DISP = Gfx_SetupDL(OVERLAY_DISP, SETUPDL_57); for (i = 0, curReticle = targetCtx->curReticle; i < numReticles; @@ -449,16 +449,16 @@ void Target_Draw(TargetContext* targetCtx, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 2158); } -void Target_Update(TargetContext* targetCtx, Player* player, Actor* curLockOnActor, PlayState* play) { +void Target_Update(TargetContext* targetCtx, Player* player, Actor* playerFocusActor, PlayState* play) { s32 pad; - Actor* actor; + Actor* actor; // used for both the Navi hover actor and reticle actor s32 category; Vec3f projectedFocusPos; f32 cappedInvWDest; actor = NULL; - if ((player->unk_664 != NULL) && + if ((player->focusActor != NULL) && (player->controlStickDirections[player->controlStickDataIndex] == PLAYER_STICK_DIR_BACKWARD)) { // Holding backward on the control stick prevents an arrow appearing over the next targetable actor. // This helps escape a targeting loop when using Switch Targeting, but note that this still works for @@ -475,9 +475,9 @@ void Target_Update(TargetContext* targetCtx, Player* player, Actor* curLockOnAct // (this feature is never used in practice) actor = targetCtx->forcedLockOnActor; targetCtx->forcedLockOnActor = NULL; - } else if (curLockOnActor != NULL) { + } else if (playerFocusActor != NULL) { // Stay locked-on to the same actor - actor = curLockOnActor; + actor = playerFocusActor; } if (actor != NULL) { @@ -512,27 +512,30 @@ void Target_Update(TargetContext* targetCtx, Player* player, Actor* curLockOnAct Target_SetNaviState(targetCtx, actor, category, play); } - // Release lock-on if the actor is off screen. - // The camera is always moving toward the locked-on actor, so it seems difficult - // to move the actor off screen, if its even possible. - if ((curLockOnActor != NULL) && (targetCtx->reticleSpinCounter == 0)) { - Actor_ProjectPos(play, &curLockOnActor->focus.pos, &projectedFocusPos, &cappedInvWDest); + if ((playerFocusActor != NULL) && (targetCtx->reticleSpinCounter == 0)) { + Actor_ProjectPos(play, &playerFocusActor->focus.pos, &projectedFocusPos, &cappedInvWDest); if (((projectedFocusPos.z <= 0.0f) || (1.0f <= fabsf(projectedFocusPos.x * cappedInvWDest))) || (1.0f <= fabsf(projectedFocusPos.y * cappedInvWDest))) { - curLockOnActor = NULL; + // Release the reticle if the actor is off screen. + // It is possible to move far enough away from an actor that it goes off screen, despite being + // locked onto it. In this case the reticle will release, but the lock-on will remain + // because Player is still updating focusActor. + // It is unclear if this is intentional, or if it is a bug and the lock-on as a whole is supposed + // to release. + playerFocusActor = NULL; } } - if (curLockOnActor != NULL) { - if (curLockOnActor != targetCtx->reticleActor) { + if (playerFocusActor != NULL) { + if (playerFocusActor != targetCtx->reticleActor) { s32 lockOnSfxId; - // Set up a new lock-on - Target_InitReticle(targetCtx, curLockOnActor->category, play); - targetCtx->reticleActor = curLockOnActor; + // Set up a new reticle + Target_InitReticle(targetCtx, playerFocusActor->category, play); + targetCtx->reticleActor = playerFocusActor; - if (curLockOnActor->id == ACTOR_EN_BOOM) { + if (playerFocusActor->id == ACTOR_EN_BOOM) { // Don't draw the reticle when locked onto the boomerang. // Note that it isn't possible to lock onto the boomerang, so this code doesn't do anything. // This implies that the boomerang camera lock may have been implemented with Z-Targeting at one point, @@ -540,17 +543,17 @@ void Target_Update(TargetContext* targetCtx, Player* player, Actor* curLockOnAct targetCtx->reticleFadeAlphaControl = 0; } - lockOnSfxId = CHECK_FLAG_ALL(curLockOnActor->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2) ? NA_SE_SY_LOCK_ON - : NA_SE_SY_LOCK_ON_HUMAN; + lockOnSfxId = CHECK_FLAG_ALL(playerFocusActor->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2) ? NA_SE_SY_LOCK_ON + : NA_SE_SY_LOCK_ON_HUMAN; Sfx_PlaySfxCentered(lockOnSfxId); } // Update reticle - targetCtx->reticlePos.x = curLockOnActor->world.pos.x; + targetCtx->reticlePos.x = playerFocusActor->world.pos.x; targetCtx->reticlePos.y = - curLockOnActor->world.pos.y - (curLockOnActor->shape.yOffset * curLockOnActor->scale.y); - targetCtx->reticlePos.z = curLockOnActor->world.pos.z; + playerFocusActor->world.pos.y - (playerFocusActor->shape.yOffset * playerFocusActor->scale.y); + targetCtx->reticlePos.z = playerFocusActor->world.pos.z; if (targetCtx->reticleSpinCounter == 0) { f32 step = (500.0f - targetCtx->reticleRadius) * 3.0f; @@ -569,7 +572,7 @@ void Target_Update(TargetContext* targetCtx, Player* player, Actor* curLockOnAct targetCtx->reticleRadius = 120.0f; } } else { - // Expand the reticle radius quickly as the lock-on is released + // Expand the radius quickly as the reticle is released targetCtx->reticleActor = NULL; Math_StepToF(&targetCtx->reticleRadius, 500.0f, 80.0f); } @@ -1579,7 +1582,7 @@ f32 Target_WeightedDistToPlayerSq(Actor* actor, Player* player, s16 playerShapeY s16 yawTemp = (s16)(actor->yawTowardsPlayer - 0x8000) - playerShapeYaw; s16 yawTempAbs = ABS(yawTemp); - if (player->unk_664 != NULL) { + if (player->focusActor != NULL) { if ((yawTempAbs > 0x4000) || (actor->flags & ACTOR_FLAG_27)) { return MAXFLOAT; } else { @@ -1635,7 +1638,7 @@ s32 func_8002F0C8(Actor* actor, Player* player, s32 flag) { s16 abs_var = ABS(var); f32 dist; - if ((player->unk_664 == NULL) && (abs_var > 0x2AAA)) { + if ((player->focusActor == NULL) && (abs_var > 0x2AAA)) { dist = MAXFLOAT; } else { dist = actor->xyzDistToPlayerSq; @@ -2330,13 +2333,13 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { actor->flags &= ~ACTOR_FLAG_24; if ((DECR(actor->freezeTimer) == 0) && (actor->flags & (ACTOR_FLAG_4 | ACTOR_FLAG_6))) { - if (actor == player->unk_664) { + if (actor == player->focusActor) { actor->isTargeted = true; } else { actor->isTargeted = false; } - if ((actor->targetPriority != 0) && (player->unk_664 == NULL)) { + if ((actor->targetPriority != 0) && (player->focusActor == NULL)) { actor->targetPriority = 0; } @@ -2359,7 +2362,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { } } - actor = player->unk_664; + actor = player->focusActor; if ((actor != NULL) && (actor->update == NULL)) { actor = NULL; @@ -3110,7 +3113,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) { ACTOR_DEBUG_PRINTF("アクタークラス削除 [%s]\n", name); // "Actor class deleted [%s]" - if ((player != NULL) && (actor == player->unk_664)) { + if ((player != NULL) && (actor == player->focusActor)) { func_8008EDF0(player); Camera_RequestMode(Play_GetCamera(play, Play_GetActiveCamId(play)), CAM_MODE_NORMAL); } @@ -3193,13 +3196,13 @@ s16 sTargetPlayerRotY; void Target_FindTargetableActorInCategory(PlayState* play, ActorContext* actorCtx, Player* player, u32 actorCategory) { f32 distSq; Actor* actor; - Actor* unk_664; + Actor* playerFocusActor; CollisionPoly* poly; s32 bgId; Vec3f lineTestResultPos; actor = actorCtx->actorLists[actorCategory].head; - unk_664 = player->unk_664; + playerFocusActor = player->focusActor; while (actor != NULL) { if ((actor->update != NULL) && ((Player*)actor != player) && CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_0)) { @@ -3210,7 +3213,7 @@ void Target_FindTargetableActorInCategory(PlayState* play, ActorContext* actorCt sBgmEnemyDistSq = actor->xyzDistToPlayerSq; } - if (actor != unk_664) { + if (actor != playerFocusActor) { distSq = Target_WeightedDistToPlayerSq(actor, player, sTargetPlayerRotY); if ((distSq < sNearestTargetableActorDistSq) && Target_ActorIsInRange(actor, distSq) && diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index c591f4834e..74cf589e49 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -602,7 +602,7 @@ void Player_UpdateBottleHeld(PlayState* play, Player* this, s32 item, s32 itemAc } void func_8008EDF0(Player* this) { - this->unk_664 = NULL; + this->focusActor = NULL; this->stateFlags2 &= ~PLAYER_STATE2_13; } @@ -624,7 +624,7 @@ void func_8008EEAC(PlayState* play, Actor* actor) { Player* this = GET_PLAYER(play); func_8008EE08(this); - this->unk_664 = actor; + this->focusActor = actor; this->unk_684 = actor; this->stateFlags1 |= PLAYER_STATE1_16; Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, actor); diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index cc84d39fd6..1c3630ff9d 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -1034,11 +1034,11 @@ void func_80A04414(EnElf* this, PlayState* play) { } if (this->fairyFlags & 1) { - if ((naviHoverActor == NULL) || (player->unk_664 == NULL)) { + if ((naviHoverActor == NULL) || (player->focusActor == NULL)) { this->fairyFlags ^= 1; } } else { - if ((naviHoverActor != NULL) && (player->unk_664 != NULL)) { + if ((naviHoverActor != NULL) && (player->focusActor != NULL)) { if (naviHoverActor->category == ACTORCAT_NPC) { sfxId = NA_SE_VO_NAVY_HELLO; } else { @@ -1224,7 +1224,8 @@ void func_80A04DE4(EnElf* this, PlayState* play) { if (this->fairyFlags & 0x10) { pos = play->actorCtx.targetCtx.naviHoverPos; - if ((player->unk_664 == NULL) || (&player->actor == player->unk_664) || (&this->actor == player->unk_664)) { + if ((player->focusActor == NULL) || (&player->actor == player->focusActor) || + (&this->actor == player->focusActor)) { pos.x = player->bodyPartsPos[PLAYER_BODYPART_HEAD].x + (Math_SinS(player->actor.shape.rot.y) * 20.0f); pos.y = player->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 5.0f; pos.z = player->bodyPartsPos[PLAYER_BODYPART_HEAD].z + (Math_CosS(player->actor.shape.rot.y) * 20.0f); @@ -1376,7 +1377,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) { EnElf* this = (EnElf*)thisx; if (player->naviTextId == 0) { - if (player->unk_664 == NULL) { + if (player->focusActor == NULL) { #if OOT_DEBUG if (((gSaveContext.save.info.playerData.naviTimer >= 600) && (gSaveContext.save.info.playerData.naviTimer <= 3000)) || diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 3057fcb640..a401bad5a3 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -539,7 +539,7 @@ s16 EnZf_FindNextPlatformTowardsPlayer(Vec3f* pos, s16 curPlatform, s16 arg2, Pl // Player not targeting this or another EnZf? s32 EnZf_CanAttack(PlayState* play, EnZf* this) { - Actor* targetedActor; + Actor* playerFocusActor; Player* player = GET_PLAYER(play); if (this->actor.params >= ENZF_TYPE_LIZALFOS_MINIBOSS_A) { // miniboss @@ -553,16 +553,16 @@ s32 EnZf_CanAttack(PlayState* play, EnZf* this) { return true; } if (this->actor.params == ENZF_TYPE_DINOLFOS) { - targetedActor = player->unk_664; - if (targetedActor == NULL) { + playerFocusActor = player->focusActor; + if (playerFocusActor == NULL) { return false; } else { - if (targetedActor->category != ACTORCAT_ENEMY) { + if (playerFocusActor->category != ACTORCAT_ENEMY) { return true; } - if (targetedActor->id != ACTOR_EN_ZF) { + if (playerFocusActor->id != ACTOR_EN_ZF) { return false; - } else if (targetedActor->colorFilterTimer != 0) { + } else if (playerFocusActor->colorFilterTimer != 0) { return true; } } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 7f56942755..9d800d3556 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -2322,7 +2322,7 @@ s32 func_80833B2C(Player* this) { } s32 func_80833B54(Player* this) { - if ((this->unk_664 != NULL) && CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2)) { + if ((this->focusActor != NULL) && CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2)) { this->stateFlags1 |= PLAYER_STATE1_4; return 1; } @@ -3096,14 +3096,14 @@ s32 func_808359FC(Player* this, PlayState* play) { } else if (LinkAnimation_OnFrame(&this->upperSkelAnime, 6.0f)) { f32 posX = (Math_SinS(this->actor.shape.rot.y) * 10.0f) + this->actor.world.pos.x; f32 posZ = (Math_CosS(this->actor.shape.rot.y) * 10.0f) + this->actor.world.pos.z; - s32 yaw = (this->unk_664 != NULL) ? this->actor.shape.rot.y + 14000 : this->actor.shape.rot.y; + s32 yaw = (this->focusActor != NULL) ? this->actor.shape.rot.y + 14000 : this->actor.shape.rot.y; EnBoom* boomerang = (EnBoom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOOM, posX, this->actor.world.pos.y + 30.0f, posZ, this->actor.focus.rot.x, yaw, 0, 0); this->boomerangActor = &boomerang->actor; if (boomerang != NULL) { - boomerang->moveTo = this->unk_664; + boomerang->moveTo = this->focusActor; boomerang->returnTimer = 20; this->stateFlags1 |= PLAYER_STATE1_25; if (!func_8008E9C4(this)) { @@ -3477,11 +3477,11 @@ void Player_UpdateShapeYaw(Player* this, PlayState* play) { s16 previousYaw = this->actor.shape.rot.y; if (!(this->stateFlags2 & (PLAYER_STATE2_5 | PLAYER_STATE2_6))) { - Actor* unk_664 = this->unk_664; + Actor* focusActor = this->focusActor; - if ((unk_664 != NULL) && + if ((focusActor != NULL) && ((play->actorCtx.targetCtx.reticleSpinCounter != 0) || (this->actor.category != ACTORCAT_PLAYER))) { - Math_ScaledStepToS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &unk_664->focus.pos), + Math_ScaledStepToS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &focusActor->focus.pos), 4000); } else if ((this->stateFlags1 & PLAYER_STATE1_17) && !(this->stateFlags2 & (PLAYER_STATE2_5 | PLAYER_STATE2_6))) { @@ -3587,15 +3587,15 @@ void func_80836BEC(Player* this, PlayState* play) { this->stateFlags1 |= PLAYER_STATE1_15; if ((actorToTarget != NULL) && !(actorToTarget->flags & ACTOR_FLAG_27)) { - if ((actorToTarget == this->unk_664) && (this->actor.category == ACTORCAT_PLAYER)) { + if ((actorToTarget == this->focusActor) && (this->actor.category == ACTORCAT_PLAYER)) { actorToTarget = play->actorCtx.targetCtx.arrowHoverActor; } - if (actorToTarget != this->unk_664) { + if (actorToTarget != this->focusActor) { if (!holdTarget) { this->stateFlags2 |= PLAYER_STATE2_13; } - this->unk_664 = actorToTarget; + this->focusActor = actorToTarget; this->unk_66C = 15; this->stateFlags2 &= ~(PLAYER_STATE2_1 | PLAYER_STATE2_21); } else { @@ -3612,23 +3612,23 @@ void func_80836BEC(Player* this, PlayState* play) { } } - if (this->unk_664 != NULL) { - if ((this->actor.category == ACTORCAT_PLAYER) && (this->unk_664 != this->unk_684) && - func_8002F0C8(this->unk_664, this, sp1C)) { + if (this->focusActor != NULL) { + if ((this->actor.category == ACTORCAT_PLAYER) && (this->focusActor != this->unk_684) && + func_8002F0C8(this->focusActor, this, sp1C)) { func_8008EDF0(this); this->stateFlags1 |= PLAYER_STATE1_30; - } else if (this->unk_664 != NULL) { - this->unk_664->targetPriority = 40; + } else if (this->focusActor != NULL) { + this->focusActor->targetPriority = 40; } } else if (this->unk_684 != NULL) { - this->unk_664 = this->unk_684; + this->focusActor = this->unk_684; } } - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { this->stateFlags1 &= ~(PLAYER_STATE1_16 | PLAYER_STATE1_17); if ((this->stateFlags1 & PLAYER_STATE1_11) || - !CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2)) { + !CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2)) { this->stateFlags1 |= PLAYER_STATE1_16; } } else { @@ -3748,9 +3748,9 @@ s32 Player_GetMovementSpeedAndYaw(Player* this, f32* outSpeedTarget, s16* outYaw if (!Player_CalcSpeedAndYawFromControlStick(play, this, outSpeedTarget, outYawTarget, speedMode)) { *outYawTarget = this->actor.shape.rot.y; - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { if ((play->actorCtx.targetCtx.reticleSpinCounter != 0) && !(this->stateFlags2 & PLAYER_STATE2_6)) { - *outYawTarget = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_664->focus.pos); + *outYawTarget = Math_Vec3f_Yaw(&this->actor.world.pos, &this->focusActor->focus.pos); return false; } } else if (func_80833B2C(this)) { @@ -5234,7 +5234,7 @@ void func_8083A2F8(PlayState* play, Player* this) { if (this->actor.textId != 0) { Message_StartTextbox(play, this->actor.textId, this->talkActor); - this->unk_664 = this->talkActor; + this->focusActor = this->talkActor; } } @@ -5667,7 +5667,7 @@ s32 Player_ActionChange_13(Player* this, PlayState* play) { this->av1.actionVar1 = -1; } talkActor->flags |= ACTOR_FLAG_TALK; - this->unk_664 = this->talkActor; + this->focusActor = this->talkActor; } else if (sp2C == EXCH_ITEM_BOTTLE_RUTOS_LETTER) { this->av1.actionVar1 = 1; this->actor.textId = 0x4005; @@ -5746,7 +5746,7 @@ s32 Player_ActionChange_13(Player* this, PlayState* play) { s32 Player_ActionChange_4(Player* this, PlayState* play) { Actor* sp34 = this->talkActor; - Actor* sp30 = this->unk_664; + Actor* sp30 = this->focusActor; Actor* sp2C = NULL; s32 sp28 = 0; s32 sp24; @@ -5835,8 +5835,8 @@ s32 Player_ActionChange_0(Player* this, PlayState* play) { return 1; } - if ((this->unk_664 != NULL) && (CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_18) || - (this->unk_664->naviEnemyId != NAVI_ENEMY_NONE))) { + if ((this->focusActor != NULL) && (CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_0 | ACTOR_FLAG_18) || + (this->focusActor->naviEnemyId != NAVI_ENEMY_NONE))) { this->stateFlags2 |= PLAYER_STATE2_21; } else if ((this->naviTextId == 0) && !func_8008E9C4(this) && CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT) && @@ -6034,7 +6034,7 @@ s32 Player_ActionChange_11(Player* this, PlayState* play) { if ((play->shootingGalleryStatus == 0) && (this->currentShield != PLAYER_SHIELD_NONE) && CHECK_BTN_ALL(sControlInput->cur.button, BTN_R) && - (Player_IsChildWithHylianShield(this) || (!func_80833B2C(this) && (this->unk_664 == NULL)))) { + (Player_IsChildWithHylianShield(this) || (!func_80833B2C(this) && (this->focusActor == NULL)))) { func_80832318(this); Player_DetachHeldActor(play, this); @@ -6586,7 +6586,7 @@ void func_8083D6EC(PlayState* play, Player* this) { } s32 func_8083DB98(Player* this, s32 arg1) { - Actor* unk_664 = this->unk_664; + Actor* focusActor = this->focusActor; Vec3f sp30; s16 sp2E; s16 sp2C; @@ -6594,8 +6594,8 @@ s32 func_8083DB98(Player* this, s32 arg1) { sp30.x = this->actor.world.pos.x; sp30.y = this->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f; sp30.z = this->actor.world.pos.z; - sp2E = Math_Vec3f_Pitch(&sp30, &unk_664->focus.pos); - sp2C = Math_Vec3f_Yaw(&sp30, &unk_664->focus.pos); + sp2E = Math_Vec3f_Pitch(&sp30, &focusActor->focus.pos); + sp2C = Math_Vec3f_Yaw(&sp30, &focusActor->focus.pos); Math_SmoothStepToS(&this->actor.focus.rot.y, sp2C, 4, 10000, 0); Math_SmoothStepToS(&this->actor.focus.rot.x, sp2E, 4, 10000, 0); this->unk_6AE |= 2; @@ -6611,7 +6611,7 @@ void func_8083DC54(Player* this, PlayState* play) { f32 temp1; Vec3f sp34; - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { if (func_8002DD78(this) || func_808334B4(this)) { func_8083DB98(this, 1); } else { @@ -7393,7 +7393,7 @@ s32 func_8083FC68(Player* this, f32 arg1, s16 arg2) { f32 sp1C = (s16)(arg2 - this->actor.shape.rot.y); f32 temp; - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { func_8083DB98(this, func_8002DD78(this) || func_808334B4(this)); } @@ -7412,7 +7412,7 @@ s32 func_8083FD78(Player* this, f32* arg1, s16* arg2, PlayState* play) { s16 sp2E = *arg2 - this->zTargetYaw; u16 sp2C = ABS(sp2E); - if ((func_8002DD78(this) || func_808334B4(this)) && (this->unk_664 == NULL)) { + if ((func_8002DD78(this) || func_808334B4(this)) && (this->focusActor == NULL)) { *arg1 *= Math_SinS(sp2C); if (*arg1 != 0.0f) { @@ -7421,14 +7421,14 @@ s32 func_8083FD78(Player* this, f32* arg1, s16* arg2, PlayState* play) { *arg2 = this->actor.shape.rot.y; } - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { func_8083DB98(this, 1); } else { Math_SmoothStepToS(&this->actor.focus.rot.x, sControlInput->rel.stick_y * 240.0f, 14, 4000, 30); func_80836AB8(this, 1); } } else { - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { return func_8083FC68(this, *arg1, *arg2); } else { func_8083DC54(this, play); @@ -7697,7 +7697,7 @@ void func_808409CC(PlayState* play, Player* this) { s32 sp38; s32 sp34; - if ((this->unk_664 != NULL) || + if ((this->focusActor != NULL) || (!(heathIsCritical = Health_IsCritical()) && ((this->unk_6AC = (this->unk_6AC + 1) & 1) != 0))) { this->stateFlags2 &= ~PLAYER_STATE2_28; anim = func_80833338(this); @@ -10377,7 +10377,7 @@ void Player_UpdateInterface(PlayState* play, Player* this) { Interface_SetDoAction(play, doAction); if (this->stateFlags2 & PLAYER_STATE2_21) { - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { Interface_SetNaviCall(play, 0x1E); } else { Interface_SetNaviCall(play, 0x1D); @@ -10730,7 +10730,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) { void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { u8 seqMode; s32 pad; - Actor* unk_664; + Actor* focusActor; s32 camMode; if (this->actor.category == ACTORCAT_PLAYER) { @@ -10746,7 +10746,7 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { camMode = CAM_MODE_STILL; } else if (this->stateFlags2 & PLAYER_STATE2_8) { camMode = CAM_MODE_PUSH_PULL; - } else if ((unk_664 = this->unk_664) != NULL) { + } else if ((focusActor = this->focusActor) != NULL) { if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_TALK)) { camMode = CAM_MODE_TALK; } else if (this->stateFlags1 & PLAYER_STATE1_16) { @@ -10758,7 +10758,7 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { } else { camMode = CAM_MODE_Z_TARGET_UNFRIENDLY; } - Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, unk_664); + Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, focusActor); } else if (this->stateFlags1 & PLAYER_STATE1_12) { camMode = CAM_MODE_CHARGE; } else if (this->stateFlags1 & PLAYER_STATE1_25) { @@ -11328,7 +11328,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { func_8083D6EC(play, this); - if ((this->unk_664 == NULL) && (this->naviTextId == 0)) { + if ((this->focusActor == NULL) && (this->naviTextId == 0)) { this->stateFlags2 &= ~(PLAYER_STATE2_1 | PLAYER_STATE2_21); } @@ -11861,7 +11861,7 @@ void Player_Action_8084B1D8(Player* this, PlayState* play) { } if ((this->csAction != PLAYER_CSACTION_NONE) || (this->unk_6AD == 0) || (this->unk_6AD >= 4) || - func_80833B54(this) || (this->unk_664 != NULL) || (func_8083AD4C(play, this) == CAM_MODE_NORMAL) || + func_80833B54(this) || (this->focusActor != NULL) || (func_8083AD4C(play, this) == CAM_MODE_NORMAL) || (((this->unk_6AD == 2) && (CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_R) || func_80833B2C(this) || (!func_8002DD78(this) && !func_808334B4(this)))) || ((this->unk_6AD == 1) && @@ -11964,7 +11964,7 @@ void Player_Action_8084B530(Player* this, PlayState* play) { } } - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { this->yaw = this->actor.shape.rot.y = func_8083DB98(this, 0); } } @@ -12735,7 +12735,7 @@ void Player_Action_8084CC98(Player* this, PlayState* play) { if ((this->csAction != PLAYER_CSACTION_NONE) || (!func_8084C9BC(this, play) && !Player_ActionChange_13(this, play))) { - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { if (func_8002DD78(this) != 0) { this->unk_6BE = func_8083DB98(this, 1) - this->actor.shape.rot.y; this->unk_6BE = CLAMP(this->unk_6BE, -0x4AAA, 0x4AAA); @@ -13561,7 +13561,7 @@ void Player_Action_8084F104(Player* this, PlayState* play) { Player_ProcessAnimSfxList(this, D_80854A3C); } - if ((this->av1.actionVar1 == 0) && (this->unk_664 != NULL)) { + if ((this->av1.actionVar1 == 0) && (this->focusActor != NULL)) { this->yaw = this->actor.shape.rot.y = func_8083DB98(this, 0); } } @@ -14626,9 +14626,9 @@ void func_80851314(Player* this) { this->csActor = NULL; } - this->unk_664 = this->csActor; + this->focusActor = this->csActor; - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { this->actor.shape.rot.y = func_8083DB98(this, 0); } }