Skip to content

Commit 9b87302

Browse files
committed
Guard against division by 0
1 parent 823b1ab commit 9b87302

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

codemp/cgame/hud_strafehelper.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,9 @@ void DF_SetFrameTime() {
692692
else {
693693
frameTime = 1.0f / cg_strafeHelper_FPS.value;
694694
}
695+
if (frameTime <= 0.0f) {
696+
frameTime = 0.001f; //1ms floor, equivalent to 1000fps cap
697+
}
695698
state.cgaz.frametime = frameTime;
696699
}
697700

0 commit comments

Comments
 (0)