mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
do something to not error on negative sv_friction and negative sv_accelerate
This commit is contained in:
parent
e41ba9fa95
commit
187bd2c975
@ -534,10 +534,13 @@ stock void TrimDisplayString(const char[] str, char[] outstr, int outstrlen, int
|
||||
// TODO: surfacefriction
|
||||
stock float MaxPrestrafe(float runspeed, float accelerate, float friction, float tickinterval)
|
||||
{
|
||||
return runspeed * SquareRoot(
|
||||
if (friction < 0.0) return 9999999.0; // hello ~~mario~~ bhop_ins_mariooo
|
||||
if (accelerate < 0.0) accelerate = -accelerate;
|
||||
float something = runspeed * SquareRoot(
|
||||
(accelerate / friction) *
|
||||
((2.0 - accelerate * tickinterval) / (2.0 - friction * tickinterval))
|
||||
);
|
||||
return something < 0.0 ? -something : something;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user