Avoid problems when bobcycle is 0.

This commit is contained in:
Shpoike 2020-04-17 03:41:23 +01:00
parent 2e1abf9fa7
commit 933155ce88

View file

@ -117,8 +117,13 @@ float V_CalcBob (void)
float bob;
float cycle;
cycle = cl.time - (int)(cl.time/cl_bobcycle.value)*cl_bobcycle.value;
cycle /= cl_bobcycle.value;
if (!cl_bobcycle.value)
cycle = 0;
else
{
cycle = cl.time - (int)(cl.time/cl_bobcycle.value)*cl_bobcycle.value;
cycle /= cl_bobcycle.value;
}
if (cycle < cl_bobup.value)
cycle = M_PI * cycle / cl_bobup.value;
else