Add CVar == validation and remove extraneous variable

This commit is contained in:
Kiloku 2024-12-28 22:27:44 -03:00 committed by Lywx
parent 874097614a
commit 4c2129a1e5
3 changed files with 6 additions and 13 deletions

View File

@ -3700,8 +3700,7 @@ void Player_MoveArwing360(Player* player) {
sp7C = -gInputPress->stick_x;
s8 YAxisMult = CVarGetInteger("gInvertYAxis", 0) ? -1 : 1;
sp78 = gInputPress->stick_y * YAxisMult;
sp78 = gInputPress->stick_y * (CVarGetInteger("gInvertYAxis", 0) == 0 ? 1 : -1);
Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 5.0f, 0.01f);
Matrix_RotateZ(gCalcMatrix, -player->zRotBank * M_DTOR, MTXF_NEW);
@ -3947,9 +3946,7 @@ void Player_MoveArwingOnRails(Player* player) {
}
stickX = -gInputPress->stick_x;
s8 YAxisMult = CVarGetInteger("gInvertYAxis", 0) ? -1 : 1;
stickY = gInputPress->stick_y * YAxisMult;
stickY = gInputPress->stick_y * (CVarGetInteger("gInvertYAxis", 0) == 0 ? 1 : -1);
Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 5.0f, 0.01f);

View File

@ -380,8 +380,7 @@ void func_tank_80044868(Player* player) {
f32 stickTilt;
f32 sp2C;
s8 YAxisMult = CVarGetInteger("gInvertYAxis", 0) ? -1 : 1;
stickTilt = (gInputPress->stick_y * 0.7f * YAxisMult) - 8.0f;
stickTilt = (gInputPress->stick_y * 0.7f * (CVarGetInteger("gInvertYAxis", 0) == 0 ? 1 : -1)) - 8.0f;
if (stickTilt < -40.0f) {
stickTilt = -40.0f;
}
@ -666,8 +665,7 @@ void func_tank_80045678(Player* player) {
}
player->zRotBank += ((__cosf(gGameFrameCount * M_DTOR * 8.0f) * 10.0f) - player->zRotBank) * 0.1f;
s8 YAxisMult = CVarGetInteger("gInvertYAxis", 0) ? -1 : 1;
temp = -gInputPress->stick_y * YAxisMult;
temp = -gInputPress->stick_y * (CVarGetInteger("gInvertYAxis", 0) == 0 ? 1 : -1);
Math_SmoothStepToF(&player->rot.x, temp * 0.3f, 0.05f, 5.0f, 0.00001f);
Math_SmoothStepToF(&player->boostSpeed, 15.0f, 0.5f, 5.0f, 0.0f);
Math_SmoothStepToF(&player->rot.z, 0.0f, 0.1f, 5.0f, 0.00001f);

View File

@ -803,8 +803,7 @@ void Aquas_801AA4BC(Player* player) {
void Aquas_UpdateCamera(Player* player) {
f32 stickX = +gInputPress->stick_x;
s8 YAxisMult = CVarGetInteger("gInvertYAxis", 0) ? -1 : 1;
f32 stickY = -gInputPress->stick_y * YAxisMult;
f32 stickY = -gInputPress->stick_y * (CVarGetInteger("gInvertYAxis", 0) == 0 ? 1 : -1);
f32 zRot;
if (player->state != PLAYERSTATE_ACTIVE) {
@ -879,8 +878,7 @@ void Aquas_BlueMarineMove(Player* player) {
stickX = -gInputPress->stick_x;
s8 YAxisMult = CVarGetInteger("gInvertYAxis", 0) ? -1 : 1;
stickY = +gInputPress->stick_y * YAxisMult;
stickY = +gInputPress->stick_y * (CVarGetInteger("gInvertYAxis", 0) == 0 ? 1 : -1);
gPlayerTurnStickMod = 0.68f;