1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-12 01:40:47 +00:00

Minor Cleanup (#2308)

* cleanup

* more

* fix floats
This commit is contained in:
engineer124 2024-12-01 23:55:50 +11:00 committed by GitHub
parent e0bd123312
commit 6199634ffb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 12 deletions

View file

@ -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

View file

@ -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)) {