1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-23 07:45:55 +00:00

Use PLAYER_AP_ enum more to compare to Player#heldItemActionParam

This commit is contained in:
Dragorn421 2021-09-21 10:32:57 +02:00
parent efe60cc88b
commit 52a91a3117
No known key found for this signature in database
GPG key ID: C182A3A3996E8201
3 changed files with 4 additions and 4 deletions

View file

@ -1619,7 +1619,7 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) {
temp_f12 = this->unk_1B8.z - player->actor.world.pos.z; temp_f12 = this->unk_1B8.z - player->actor.world.pos.z;
temp_a0_2 = Math_Atan2S(temp_f12, temp_f14) - player->actor.shape.rot.y; temp_a0_2 = Math_Atan2S(temp_f12, temp_f14) - player->actor.shape.rot.y;
if ((ABS(temp_a0_2) < 0x2000) && (sqrtf(SQ(temp_f14) + SQ(temp_f12)) < 70.0f) && if ((ABS(temp_a0_2) < 0x2000) && (sqrtf(SQ(temp_f14) + SQ(temp_f12)) < 70.0f) &&
(player->swordState != 0) && (player->heldItemActionParam == 3)) { (player->swordState != 0) && (player->heldItemActionParam == PLAYER_AP_SWORD_MASTER)) {
func_80064520(globalCtx, &globalCtx->csCtx); func_80064520(globalCtx, &globalCtx->csCtx);
this->unk_39E = Gameplay_CreateSubCamera(globalCtx); this->unk_39E = Gameplay_CreateSubCamera(globalCtx);
Gameplay_ChangeCameraStatus(globalCtx, MAIN_CAM, CAM_STAT_WAIT); Gameplay_ChangeCameraStatus(globalCtx, MAIN_CAM, CAM_STAT_WAIT);

View file

@ -271,7 +271,7 @@ void EnButte_FlyAround(EnButte* this, GlobalContext* globalCtx) {
EnButte_SelectFlightParams(this, &sFlyAroundParams[this->flightParamsIdx]); EnButte_SelectFlightParams(this, &sFlyAroundParams[this->flightParamsIdx]);
} }
if (((this->actor.params & 1) == 1) && (player->heldItemActionParam == 6) && (this->swordDownTimer <= 0) && if (((this->actor.params & 1) == 1) && (player->heldItemActionParam == PLAYER_AP_STICK) && (this->swordDownTimer <= 0) &&
((Math3D_Dist2DSq(player->actor.world.pos.x, player->actor.world.pos.z, this->actor.home.pos.x, ((Math3D_Dist2DSq(player->actor.world.pos.x, player->actor.world.pos.z, this->actor.home.pos.x,
this->actor.home.pos.z) < SQ(120.0f)) || this->actor.home.pos.z) < SQ(120.0f)) ||
(this->actor.xzDistToPlayer < 60.0f))) { (this->actor.xzDistToPlayer < 60.0f))) {
@ -336,7 +336,7 @@ void EnButte_FollowLink(EnButte* this, GlobalContext* globalCtx) {
distSqFromHome = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x, distSqFromHome = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x,
this->actor.home.pos.z); this->actor.home.pos.z);
if (!((player->heldItemActionParam == 6) && (fabsf(player->actor.speedXZ) < 1.8f) && (this->swordDownTimer <= 0) && if (!((player->heldItemActionParam == PLAYER_AP_STICK) && (fabsf(player->actor.speedXZ) < 1.8f) && (this->swordDownTimer <= 0) &&
(distSqFromHome < SQ(320.0f)))) { (distSqFromHome < SQ(320.0f)))) {
EnButte_SetupFlyAround(this); EnButte_SetupFlyAround(this);
} else if (distSqFromHome > SQ(240.0f)) { } else if (distSqFromHome > SQ(240.0f)) {

View file

@ -177,7 +177,7 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) {
if (dmgFlags & 0x20820) { if (dmgFlags & 0x20820) {
interactionType = 1; interactionType = 1;
} }
} else if (player->heldItemActionParam == 6) { } else if (player->heldItemActionParam == PLAYER_AP_STICK) {
Math_Vec3f_Diff(&player->swordInfo[0].tip, &this->actor.world.pos, &tipToFlame); Math_Vec3f_Diff(&player->swordInfo[0].tip, &this->actor.world.pos, &tipToFlame);
tipToFlame.y -= 67.0f; tipToFlame.y -= 67.0f;
if ((SQ(tipToFlame.x) + SQ(tipToFlame.y) + SQ(tipToFlame.z)) < SQ(20.0f)) { if ((SQ(tipToFlame.x) + SQ(tipToFlame.y) + SQ(tipToFlame.z)) < SQ(20.0f)) {