PMove: make sv_maxspeed actually controlls players speed

This commit is contained in:
Ivan Kukush 2022-07-16 00:17:54 +03:00
parent ac0e739170
commit 9455596a3a
1 changed files with 3 additions and 1 deletions

View File

@ -299,7 +299,9 @@ NSClientPlayer::Physics_WaterMove(void)
float
NSClientPlayer::Physics_MaxSpeed(void)
{
return (GetFlags() & FL_CROUCHING) ? 135 : 270;
float maxspeed = serverkeyfloat("phy_maxspeed");
float desiredspeed = (GetFlags() & FL_CROUCHING) ? PMOVE_STEP_WALKSPEED : maxspeed;
return min(desiredspeed, maxspeed);
}
void