From a1136f4d61bf0af3c5370e8292d22ff31a34d98a Mon Sep 17 00:00:00 2001 From: AL2009man <67606569+AL2009man@users.noreply.github.com> Date: Fri, 16 May 2025 00:36:17 -0400 Subject: [PATCH 1/5] fixed Mouse Sensitivity affecting FOV Slider Your mouse sens scale should now behave exactly the same, regardless of FOV Slider --- src/game/bondmove.c | 164 ++++++++++++++++++++++---------------------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/src/game/bondmove.c b/src/game/bondmove.c index 1a5dcb6a8..383ec3abf 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -328,112 +328,112 @@ void bmoveUpdateSpeedTheta(void) f32 bmoveGetSpeedVertaLimit(f32 value) { - if (value > 0) { - return (viGetFovY() * value * -0.7f) / 60.0f; - } + if (value > 0) { + return (value * -0.7f); + } - if (value < 0) { - return (viGetFovY() * -value * 0.7f) / 60.0f; - } + if (value < 0) { + return (-value * 0.7f); + } - return 0; + return 0; } void bmoveUpdateSpeedVerta(f32 value) { - f32 mult = viGetFovY() / 60.0f; - f32 limit = bmoveGetSpeedVertaLimit(value); + f32 mult = 1.0f; + f32 limit = bmoveGetSpeedVertaLimit(value); - if (value > 0) { - if (g_Vars.currentplayer->speedverta > 0) { - g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; - } else { - g_Vars.currentplayer->speedverta -= 0.0125f * g_Vars.lvupdate60freal * mult; - } + if (value > 0) { + if (g_Vars.currentplayer->speedverta > 0) { + g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; + } else { + g_Vars.currentplayer->speedverta -= 0.0125f * g_Vars.lvupdate60freal * mult; + } - if (g_Vars.currentplayer->speedverta < limit) { - g_Vars.currentplayer->speedverta = limit; - } - } else if (value < 0) { - if (g_Vars.currentplayer->speedverta < 0) { - g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; - } else { - g_Vars.currentplayer->speedverta += 0.0125f * g_Vars.lvupdate60freal * mult; - } + if (g_Vars.currentplayer->speedverta < limit) { + g_Vars.currentplayer->speedverta = limit; + } + } else if (value < 0) { + if (g_Vars.currentplayer->speedverta < 0) { + g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; + } else { + g_Vars.currentplayer->speedverta += 0.0125f * g_Vars.lvupdate60freal * mult; + } - if (g_Vars.currentplayer->speedverta > limit) { - g_Vars.currentplayer->speedverta = limit; - } - } else { - if (g_Vars.currentplayer->speedverta > limit) { - g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; + if (g_Vars.currentplayer->speedverta > limit) { + g_Vars.currentplayer->speedverta = limit; + } + } else { + if (g_Vars.currentplayer->speedverta > limit) { + g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; - if (g_Vars.currentplayer->speedverta < limit) { - g_Vars.currentplayer->speedverta = limit; - } - } else { - g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; + if (g_Vars.currentplayer->speedverta < limit) { + g_Vars.currentplayer->speedverta = limit; + } + } else { + g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; - if (g_Vars.currentplayer->speedverta > limit) { - g_Vars.currentplayer->speedverta = limit; - } - } - } + if (g_Vars.currentplayer->speedverta > limit) { + g_Vars.currentplayer->speedverta = limit; + } + } + } } f32 bmoveGetSpeedThetaControlLimit(f32 value) { - if (value > 0) { - return (viGetFovY() * value * -0.7f) / 60.0f; - } + if (value > 0) { + return (value * -0.7f); + } - if (value < 0) { - return (viGetFovY() * -value * 0.7f) / 60.0f; - } + if (value < 0) { + return (-value * 0.7f); + } - return 0; + return 0; } void bmoveUpdateSpeedThetaControl(f32 value) { - f32 mult = viGetFovY() / 60.0f; - f32 limit = bmoveGetSpeedThetaControlLimit(value); + f32 mult = 1.0f; + f32 limit = bmoveGetSpeedThetaControlLimit(value); - if (value > 0) { - if (g_Vars.currentplayer->speedthetacontrol > 0) { - g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; - } else { - g_Vars.currentplayer->speedthetacontrol -= 0.0125f * g_Vars.lvupdate60freal * mult; - } + if (value > 0) { + if (g_Vars.currentplayer->speedthetacontrol > 0) { + g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; + } else { + g_Vars.currentplayer->speedthetacontrol -= 0.0125f * g_Vars.lvupdate60freal * mult; + } - if (g_Vars.currentplayer->speedthetacontrol < limit) { - g_Vars.currentplayer->speedthetacontrol = limit; - } - } else if (value < 0) { - if (g_Vars.currentplayer->speedthetacontrol < 0.0f) { - g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; - } else { - g_Vars.currentplayer->speedthetacontrol += 0.0125f * g_Vars.lvupdate60freal * mult; - } + if (g_Vars.currentplayer->speedthetacontrol < limit) { + g_Vars.currentplayer->speedthetacontrol = limit; + } + } else if (value < 0) { + if (g_Vars.currentplayer->speedthetacontrol < 0.0f) { + g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; + } else { + g_Vars.currentplayer->speedthetacontrol += 0.0125f * g_Vars.lvupdate60freal * mult; + } - if (g_Vars.currentplayer->speedthetacontrol > limit) { - g_Vars.currentplayer->speedthetacontrol = limit; - } - } else { - if (g_Vars.currentplayer->speedthetacontrol > limit) { - g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; + if (g_Vars.currentplayer->speedthetacontrol > limit) { + g_Vars.currentplayer->speedthetacontrol = limit; + } + } else { + if (g_Vars.currentplayer->speedthetacontrol > limit) { + g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; - if (g_Vars.currentplayer->speedthetacontrol < limit) { - g_Vars.currentplayer->speedthetacontrol = limit; - } - } else { - g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; + if (g_Vars.currentplayer->speedthetacontrol < limit) { + g_Vars.currentplayer->speedthetacontrol = limit; + } + } else { + g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; - if (g_Vars.currentplayer->speedthetacontrol > limit) { - g_Vars.currentplayer->speedthetacontrol = limit; - } - } - } + if (g_Vars.currentplayer->speedthetacontrol > limit) { + g_Vars.currentplayer->speedthetacontrol = limit; + } + } + } } /** @@ -2032,7 +2032,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } } else { if (movedata.cannaturalpitch) { - tmp = viGetFovY() / 60.0f; + tmp = 1.0f; fVar25 = movedata.analogpitch / 70.0f; if (fVar25 > 1) { @@ -2073,7 +2073,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } if (movedata.cannaturalturn) { - tmp = viGetFovY() / 60.0f; + tmp = 1.0f; fVar25 = movedata.analogturn / 70.0f; if (fVar25 > 1) { From 73631e8d5f002cf7ecb12905e3f89c6d8c797cbe Mon Sep 17 00:00:00 2001 From: AL2009man <67606569+AL2009man@users.noreply.github.com> Date: Fri, 16 May 2025 00:42:34 -0400 Subject: [PATCH 2/5] attempted whitespace fix 1 --- src/game/bondmove.c | 97 +++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 56 deletions(-) diff --git a/src/game/bondmove.c b/src/game/bondmove.c index 383ec3abf..54469a408 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -326,116 +326,101 @@ void bmoveUpdateSpeedTheta(void) } } -f32 bmoveGetSpeedVertaLimit(f32 value) -{ - if (value > 0) { - return (value * -0.7f); +f32 bmoveGetSpeedVertaLimit(f32 value){ + if(value > 0){ + return(value * -0.7f); } - - if (value < 0) { - return (-value * 0.7f); + if(value < 0){ + return(-value * 0.7f); } - return 0; } -void bmoveUpdateSpeedVerta(f32 value) -{ +void bmoveUpdateSpeedVerta(f32 value){ f32 mult = 1.0f; f32 limit = bmoveGetSpeedVertaLimit(value); - - if (value > 0) { - if (g_Vars.currentplayer->speedverta > 0) { + + if(value > 0){ + if(g_Vars.currentplayer->speedverta > 0){ g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; - } else { + }else{ g_Vars.currentplayer->speedverta -= 0.0125f * g_Vars.lvupdate60freal * mult; } - - if (g_Vars.currentplayer->speedverta < limit) { + if(g_Vars.currentplayer->speedverta < limit){ g_Vars.currentplayer->speedverta = limit; } - } else if (value < 0) { - if (g_Vars.currentplayer->speedverta < 0) { + }else if(value < 0){ + if(g_Vars.currentplayer->speedverta < 0){ g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; - } else { + }else{ g_Vars.currentplayer->speedverta += 0.0125f * g_Vars.lvupdate60freal * mult; } - - if (g_Vars.currentplayer->speedverta > limit) { + if(g_Vars.currentplayer->speedverta > limit){ g_Vars.currentplayer->speedverta = limit; } - } else { - if (g_Vars.currentplayer->speedverta > limit) { + }else{ + if(g_Vars.currentplayer->speedverta > limit){ g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; - - if (g_Vars.currentplayer->speedverta < limit) { + if(g_Vars.currentplayer->speedverta < limit){ g_Vars.currentplayer->speedverta = limit; } - } else { + }else{ g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; - - if (g_Vars.currentplayer->speedverta > limit) { + if(g_Vars.currentplayer->speedverta > limit){ g_Vars.currentplayer->speedverta = limit; } } } } -f32 bmoveGetSpeedThetaControlLimit(f32 value) -{ - if (value > 0) { - return (value * -0.7f); +f32 bmoveGetSpeedThetaControlLimit(f32 value){ + if(value > 0){ + return(value * -0.7f); } - - if (value < 0) { - return (-value * 0.7f); + if(value < 0){ + return(-value * 0.7f); } - return 0; } -void bmoveUpdateSpeedThetaControl(f32 value) -{ +void bmoveUpdateSpeedThetaControl(f32 value){ f32 mult = 1.0f; f32 limit = bmoveGetSpeedThetaControlLimit(value); - - if (value > 0) { - if (g_Vars.currentplayer->speedthetacontrol > 0) { + + if(value > 0){ + if(g_Vars.currentplayer->speedthetacontrol > 0){ g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; - } else { + }else{ g_Vars.currentplayer->speedthetacontrol -= 0.0125f * g_Vars.lvupdate60freal * mult; } - - if (g_Vars.currentplayer->speedthetacontrol < limit) { + if(g_Vars.currentplayer->speedthetacontrol < limit){ g_Vars.currentplayer->speedthetacontrol = limit; } - } else if (value < 0) { - if (g_Vars.currentplayer->speedthetacontrol < 0.0f) { + }else if(value < 0){ + if(g_Vars.currentplayer->speedthetacontrol < 0.0f){ g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; - } else { + }else{ g_Vars.currentplayer->speedthetacontrol += 0.0125f * g_Vars.lvupdate60freal * mult; } - - if (g_Vars.currentplayer->speedthetacontrol > limit) { + if(g_Vars.currentplayer->speedthetacontrol > limit){ g_Vars.currentplayer->speedthetacontrol = limit; } - } else { - if (g_Vars.currentplayer->speedthetacontrol > limit) { + }else{ + if(g_Vars.currentplayer->speedthetacontrol > limit){ g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; - - if (g_Vars.currentplayer->speedthetacontrol < limit) { + if(g_Vars.currentplayer->speedthetacontrol < limit){ g_Vars.currentplayer->speedthetacontrol = limit; } - } else { + }else{ g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; - - if (g_Vars.currentplayer->speedthetacontrol > limit) { + if(g_Vars.currentplayer->speedthetacontrol > limit){ g_Vars.currentplayer->speedthetacontrol = limit; } } } } + /** * Calculate the lookahead angle. * From 11d02dd8f26833adc9a4f888dcc8641b0ae6a08b Mon Sep 17 00:00:00 2001 From: AL2009man <67606569+AL2009man@users.noreply.github.com> Date: Fri, 16 May 2025 00:46:08 -0400 Subject: [PATCH 3/5] last attempt on whitespace fix --- src/game/bondmove.c | 188 ++++++++++++++++++++++++-------------------- 1 file changed, 101 insertions(+), 87 deletions(-) diff --git a/src/game/bondmove.c b/src/game/bondmove.c index 54469a408..510485f2b 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -326,98 +326,112 @@ void bmoveUpdateSpeedTheta(void) } } -f32 bmoveGetSpeedVertaLimit(f32 value){ - if(value > 0){ - return(value * -0.7f); - } - if(value < 0){ - return(-value * 0.7f); - } - return 0; +f32 bmoveGetSpeedVertaLimit(f32 value) +{ + if (value > 0) { + return(value * -0.7f); + } + if (value < 0) { + return(-value * 0.7f); + } + return 0; } -void bmoveUpdateSpeedVerta(f32 value){ - f32 mult = 1.0f; - f32 limit = bmoveGetSpeedVertaLimit(value); - - if(value > 0){ - if(g_Vars.currentplayer->speedverta > 0){ - g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; - }else{ - g_Vars.currentplayer->speedverta -= 0.0125f * g_Vars.lvupdate60freal * mult; - } - if(g_Vars.currentplayer->speedverta < limit){ - g_Vars.currentplayer->speedverta = limit; - } - }else if(value < 0){ - if(g_Vars.currentplayer->speedverta < 0){ - g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; - }else{ - g_Vars.currentplayer->speedverta += 0.0125f * g_Vars.lvupdate60freal * mult; - } - if(g_Vars.currentplayer->speedverta > limit){ - g_Vars.currentplayer->speedverta = limit; - } - }else{ - if(g_Vars.currentplayer->speedverta > limit){ - g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; - if(g_Vars.currentplayer->speedverta < limit){ - g_Vars.currentplayer->speedverta = limit; - } - }else{ - g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; - if(g_Vars.currentplayer->speedverta > limit){ - g_Vars.currentplayer->speedverta = limit; - } - } - } +void bmoveUpdateSpeedVerta(f32 value) +{ + f32 mult = 1.0f; + f32 limit = bmoveGetSpeedVertaLimit(value); + + if (value > 0) { + if (g_Vars.currentplayer->speedverta > 0) { + g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; + } + else { + g_Vars.currentplayer->speedverta -= 0.0125f * g_Vars.lvupdate60freal * mult; + } + if (g_Vars.currentplayer->speedverta < limit) { + g_Vars.currentplayer->speedverta = limit; + } + } + else if (value < 0) { + if (g_Vars.currentplayer->speedverta < 0) { + g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; + } + else { + g_Vars.currentplayer->speedverta += 0.0125f * g_Vars.lvupdate60freal * mult; + } + if (g_Vars.currentplayer->speedverta > limit) { + g_Vars.currentplayer->speedverta = limit; + } + } + else { + if (g_Vars.currentplayer->speedverta > limit) { + g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; + if (g_Vars.currentplayer->speedverta < limit) { + g_Vars.currentplayer->speedverta = limit; + } + } + else { + g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; + if (g_Vars.currentplayer->speedverta > limit) { + g_Vars.currentplayer->speedverta = limit; + } + } + } } -f32 bmoveGetSpeedThetaControlLimit(f32 value){ - if(value > 0){ - return(value * -0.7f); - } - if(value < 0){ - return(-value * 0.7f); - } - return 0; +f32 bmoveGetSpeedThetaControlLimit(f32 value) +{ + if (value > 0) { + return(value * -0.7f); + } + if (value < 0) { + return(-value * 0.7f); + } + return 0; } -void bmoveUpdateSpeedThetaControl(f32 value){ - f32 mult = 1.0f; - f32 limit = bmoveGetSpeedThetaControlLimit(value); - - if(value > 0){ - if(g_Vars.currentplayer->speedthetacontrol > 0){ - g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; - }else{ - g_Vars.currentplayer->speedthetacontrol -= 0.0125f * g_Vars.lvupdate60freal * mult; - } - if(g_Vars.currentplayer->speedthetacontrol < limit){ - g_Vars.currentplayer->speedthetacontrol = limit; - } - }else if(value < 0){ - if(g_Vars.currentplayer->speedthetacontrol < 0.0f){ - g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; - }else{ - g_Vars.currentplayer->speedthetacontrol += 0.0125f * g_Vars.lvupdate60freal * mult; - } - if(g_Vars.currentplayer->speedthetacontrol > limit){ - g_Vars.currentplayer->speedthetacontrol = limit; - } - }else{ - if(g_Vars.currentplayer->speedthetacontrol > limit){ - g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; - if(g_Vars.currentplayer->speedthetacontrol < limit){ - g_Vars.currentplayer->speedthetacontrol = limit; - } - }else{ - g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; - if(g_Vars.currentplayer->speedthetacontrol > limit){ - g_Vars.currentplayer->speedthetacontrol = limit; - } - } - } +void bmoveUpdateSpeedThetaControl(f32 value) +{ + f32 mult = 1.0f; + f32 limit = bmoveGetSpeedThetaControlLimit(value); + + if (value > 0) { + if (g_Vars.currentplayer->speedthetacontrol > 0) { + g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; + } + else { + g_Vars.currentplayer->speedthetacontrol -= 0.0125f * g_Vars.lvupdate60freal * mult; + } + if (g_Vars.currentplayer->speedthetacontrol < limit) { + g_Vars.currentplayer->speedthetacontrol = limit; + } + } + else if (value < 0) { + if (g_Vars.currentplayer->speedthetacontrol < 0.0f) { + g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; + } + else { + g_Vars.currentplayer->speedthetacontrol += 0.0125f * g_Vars.lvupdate60freal * mult; + } + if (g_Vars.currentplayer->speedthetacontrol > limit) { + g_Vars.currentplayer->speedthetacontrol = limit; + } + } + else { + if (g_Vars.currentplayer->speedthetacontrol > limit) { + g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; + if (g_Vars.currentplayer->speedthetacontrol < limit) { + g_Vars.currentplayer->speedthetacontrol = limit; + } + } + else { + g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; + if (g_Vars.currentplayer->speedthetacontrol > limit) { + g_Vars.currentplayer->speedthetacontrol = limit; + } + } + } } @@ -2017,7 +2031,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } } else { if (movedata.cannaturalpitch) { - tmp = 1.0f; + tmp = 1.0f; fVar25 = movedata.analogpitch / 70.0f; if (fVar25 > 1) { From cdd116830d12251a835342f76f12ec7db06373ac Mon Sep 17 00:00:00 2001 From: AL2009man <67606569+AL2009man@users.noreply.github.com> Date: Fri, 16 May 2025 00:50:57 -0400 Subject: [PATCH 4/5] fixed tmp spacing --- src/game/bondmove.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/bondmove.c b/src/game/bondmove.c index 510485f2b..42419f2a9 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -2031,7 +2031,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } } else { if (movedata.cannaturalpitch) { - tmp = 1.0f; + tmp = 1.0f; fVar25 = movedata.analogpitch / 70.0f; if (fVar25 > 1) { From d8aefc33fcb3bf4cbeab13f7e7d6efb0ff9e920d Mon Sep 17 00:00:00 2001 From: AL2009man <67606569+AL2009man@users.noreply.github.com> Date: Fri, 16 May 2025 19:26:46 -0400 Subject: [PATCH 5/5] fixed Sniper Rilfle zoom when using FOV higher than 60% Removing the scaling entirely beraks Sniper Rifle zoom. So: we're switching back to FOV Scaling, but now it'll be based on `PLAYER_DEFAULT_FOV` instead of `60.0f`. This now ensures tha --- src/game/bondmove.c | 175 ++++++++++++++++++++++---------------------- 1 file changed, 88 insertions(+), 87 deletions(-) diff --git a/src/game/bondmove.c b/src/game/bondmove.c index 42419f2a9..64e6dee60 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -328,113 +328,114 @@ void bmoveUpdateSpeedTheta(void) f32 bmoveGetSpeedVertaLimit(f32 value) { - if (value > 0) { - return(value * -0.7f); - } - if (value < 0) { - return(-value * 0.7f); - } - return 0; + if (value > 0) { + return (viGetFovY() * value * -0.7f) / PLAYER_DEFAULT_FOV; + } + + if (value < 0) { + return (viGetFovY() * -value * 0.7f) / PLAYER_DEFAULT_FOV; + } + + return 0; } void bmoveUpdateSpeedVerta(f32 value) { - f32 mult = 1.0f; - f32 limit = bmoveGetSpeedVertaLimit(value); + f32 mult = viGetFovY() / PLAYER_DEFAULT_FOV; + f32 limit = bmoveGetSpeedVertaLimit(value); - if (value > 0) { - if (g_Vars.currentplayer->speedverta > 0) { - g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; - } - else { - g_Vars.currentplayer->speedverta -= 0.0125f * g_Vars.lvupdate60freal * mult; - } - if (g_Vars.currentplayer->speedverta < limit) { - g_Vars.currentplayer->speedverta = limit; - } + if (value > 0) { + if (g_Vars.currentplayer->speedverta > 0) { + g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; + } else { + g_Vars.currentplayer->speedverta -= 0.0125f * g_Vars.lvupdate60freal * mult; } - else if (value < 0) { - if (g_Vars.currentplayer->speedverta < 0) { - g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; - } - else { - g_Vars.currentplayer->speedverta += 0.0125f * g_Vars.lvupdate60freal * mult; - } - if (g_Vars.currentplayer->speedverta > limit) { - g_Vars.currentplayer->speedverta = limit; - } + + if (g_Vars.currentplayer->speedverta < limit) { + g_Vars.currentplayer->speedverta = limit; } - else { - if (g_Vars.currentplayer->speedverta > limit) { - g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; - if (g_Vars.currentplayer->speedverta < limit) { - g_Vars.currentplayer->speedverta = limit; - } - } - else { - g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; - if (g_Vars.currentplayer->speedverta > limit) { - g_Vars.currentplayer->speedverta = limit; - } - } + } else if (value < 0) { + if (g_Vars.currentplayer->speedverta < 0) { + g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; + } else { + g_Vars.currentplayer->speedverta += 0.0125f * g_Vars.lvupdate60freal * mult; } + + if (g_Vars.currentplayer->speedverta > limit) { + g_Vars.currentplayer->speedverta = limit; + } + } else { + if (g_Vars.currentplayer->speedverta > limit) { + g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult; + + if (g_Vars.currentplayer->speedverta < limit) { + g_Vars.currentplayer->speedverta = limit; + } + } else { + g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult; + + if (g_Vars.currentplayer->speedverta > limit) { + g_Vars.currentplayer->speedverta = limit; + } + } + } } f32 bmoveGetSpeedThetaControlLimit(f32 value) { - if (value > 0) { - return(value * -0.7f); - } - if (value < 0) { - return(-value * 0.7f); - } - return 0; + if (value > 0) { + return (viGetFovY() * value * -0.7f) / PLAYER_DEFAULT_FOV; + } + + if (value < 0) { + return (viGetFovY() * -value * 0.7f) / PLAYER_DEFAULT_FOV; + } + + return 0; } void bmoveUpdateSpeedThetaControl(f32 value) { - f32 mult = 1.0f; - f32 limit = bmoveGetSpeedThetaControlLimit(value); + f32 mult = viGetFovY() / PLAYER_DEFAULT_FOV; + f32 limit = bmoveGetSpeedThetaControlLimit(value); - if (value > 0) { - if (g_Vars.currentplayer->speedthetacontrol > 0) { - g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; - } - else { - g_Vars.currentplayer->speedthetacontrol -= 0.0125f * g_Vars.lvupdate60freal * mult; - } - if (g_Vars.currentplayer->speedthetacontrol < limit) { - g_Vars.currentplayer->speedthetacontrol = limit; - } + if (value > 0) { + if (g_Vars.currentplayer->speedthetacontrol > 0) { + g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; + } else { + g_Vars.currentplayer->speedthetacontrol -= 0.0125f * g_Vars.lvupdate60freal * mult; } - else if (value < 0) { - if (g_Vars.currentplayer->speedthetacontrol < 0.0f) { - g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; - } - else { - g_Vars.currentplayer->speedthetacontrol += 0.0125f * g_Vars.lvupdate60freal * mult; - } - if (g_Vars.currentplayer->speedthetacontrol > limit) { - g_Vars.currentplayer->speedthetacontrol = limit; - } + + if (g_Vars.currentplayer->speedthetacontrol < limit) { + g_Vars.currentplayer->speedthetacontrol = limit; } - else { - if (g_Vars.currentplayer->speedthetacontrol > limit) { - g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; - if (g_Vars.currentplayer->speedthetacontrol < limit) { - g_Vars.currentplayer->speedthetacontrol = limit; - } - } - else { - g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; - if (g_Vars.currentplayer->speedthetacontrol > limit) { - g_Vars.currentplayer->speedthetacontrol = limit; - } - } + } else if (value < 0) { + if (g_Vars.currentplayer->speedthetacontrol < 0.0f) { + g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; + } else { + g_Vars.currentplayer->speedthetacontrol += 0.0125f * g_Vars.lvupdate60freal * mult; } + + if (g_Vars.currentplayer->speedthetacontrol > limit) { + g_Vars.currentplayer->speedthetacontrol = limit; + } + } else { + if (g_Vars.currentplayer->speedthetacontrol > limit) { + g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult; + + if (g_Vars.currentplayer->speedthetacontrol < limit) { + g_Vars.currentplayer->speedthetacontrol = limit; + } + } else { + g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult; + + if (g_Vars.currentplayer->speedthetacontrol > limit) { + g_Vars.currentplayer->speedthetacontrol = limit; + } + } + } } - /** * Calculate the lookahead angle. * @@ -2031,7 +2032,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } } else { if (movedata.cannaturalpitch) { - tmp = 1.0f; + tmp = viGetFovY() / PLAYER_DEFAULT_FOV; fVar25 = movedata.analogpitch / 70.0f; if (fVar25 > 1) { @@ -2072,7 +2073,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } if (movedata.cannaturalturn) { - tmp = 1.0f; + tmp = viGetFovY() / PLAYER_DEFAULT_FOV; fVar25 = movedata.analogturn / 70.0f; if (fVar25 > 1) {