From 6199634ffb42872d053abb1502eb80474de4ae56 Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Sun, 1 Dec 2024 23:55:50 +1100 Subject: Minor Cleanup (#2308) * cleanup * more * fix floats --- src/overlays/actors/ovl_En_Torch2/z_en_torch2.c | 2 +- src/overlays/actors/ovl_player_actor/z_player.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 6b0ba4cea..bef80ab31 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -618,7 +618,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { } } this->actor.colChkInfo.damage = 0; - this->knockbackDamage = PLAYER_KNOCKBACK_NONE; + this->knockbackDamage = 0; } // Handles being frozen by a deku nut diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 082f6ccfc..ceed64a30 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -7254,7 +7254,7 @@ s32 Player_HandleSlopes(PlayState* play, Player* this, CollisionPoly* floorPoly) if (sFloorShapePitch >= 0) { this->av1.facingUpSlope = true; } - Player_AnimChangeLoopMorph(play, this, sSlopeSlideAnims[this->av1.actionVar1]); + Player_AnimChangeLoopMorph(play, this, sSlopeSlideAnims[this->av1.facingUpSlope]); this->speedXZ = sqrtf(SQ(this->actor.velocity.x) + SQ(this->actor.velocity.z)); this->yaw = playerVelYaw; return true; @@ -14244,17 +14244,17 @@ void Player_Action_SlideOnSlope(Player* this, PlayState* play) { shapeYawTarget = downwardSlopeYaw + 0x8000; } - if (this->speedXZ < 0) { + if (this->speedXZ < 0.0f) { downwardSlopeYaw += 0x8000; } xzSpeedTarget = (1.0f - slopeNormal.y) * 40.0f; - xzSpeedTarget = CLAMP(xzSpeedTarget, 0, 10.0f); + xzSpeedTarget = CLAMP(xzSpeedTarget, 0.0f, 10.0f); xzSpeedIncrStep = SQ(xzSpeedTarget) * 0.015f; xzSpeedDecrStep = slopeNormal.y * 0.01f; if (SurfaceType_GetFloorEffect(&play->colCtx, floorPoly, this->actor.floorBgId) != FLOOR_EFFECT_1) { - xzSpeedTarget = 0; + xzSpeedTarget = 0.0f; xzSpeedDecrStep = slopeNormal.y * 10.0f; } @@ -14262,7 +14262,8 @@ void Player_Action_SlideOnSlope(Player* this, PlayState* play) { xzSpeedIncrStep = 1.0f; } - if (Math_AsymStepToF(&this->speedXZ, xzSpeedTarget, xzSpeedIncrStep, xzSpeedDecrStep) && (xzSpeedTarget == 0)) { + if (Math_AsymStepToF(&this->speedXZ, xzSpeedTarget, xzSpeedIncrStep, xzSpeedDecrStep) && + (xzSpeedTarget == 0.0f)) { LinkAnimationHeader* slideAnimation; if (!this->av1.facingUpSlope) { @@ -14315,7 +14316,7 @@ void Player_Action_BlueWarpArrive(Player* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->skelAnime.endFrame = this->skelAnime.animLength - 1.0f; Player_PlayLandingSfx(this); - this->av2.actionVar2 = 1; + this->av2.playedLandingSfx = true; } } else { if ((play->sceneId == SCENE_KOKIRI_FOREST) && Player_StartCsAction(play, this)) { -- cgit v1.2.3