Fix a division by 0
authorMario <mario.mario@y7mail.com>
Tue, 14 Jan 2020 17:15:37 +0000 (03:15 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 14 Jan 2020 17:15:37 +0000 (03:15 +1000)
qcsrc/lib/csqcmodel/cl_player.qc

index 2af309c..a7937c3 100644 (file)
@@ -82,7 +82,7 @@ void CSQCPlayer_SetPredictionError(vector o, vector v, float onground_diff)
 
        csqcplayer_predictionerroro = CSQCPlayer_GetPredictionErrorO() + o;
        csqcplayer_predictionerrorv = CSQCPlayer_GetPredictionErrorV() + v;
-       csqcplayer_predictionerrorfactor = autocvar_cl_movement_errorcompensation / ticrate;
+       csqcplayer_predictionerrorfactor = autocvar_cl_movement_errorcompensation / ((ticrate) ? ticrate : 1);
        csqcplayer_predictionerrortime = time + 1.0 / csqcplayer_predictionerrorfactor;
 }