Clamp r_maxfps to a minimum of 30 if not 0

git-svn-id: https://svn.eduke32.com/eduke32@6249 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2017-06-24 06:31:12 +00:00
parent ccb6d27349
commit e14d7d2786

View file

@ -1411,6 +1411,7 @@ static int32_t osdcmd_cvar_set_game(const osdfuncparm_t *parm)
} }
else if (!Bstrcasecmp(parm->name, "r_maxfps")) else if (!Bstrcasecmp(parm->name, "r_maxfps"))
{ {
if (r_maxfps != 0) r_maxfps = clamp(r_maxfps, 30, 1000);
g_frameDelay = r_maxfps ? Blrintf(1000.f/(float)r_maxfps) : 0; g_frameDelay = r_maxfps ? Blrintf(1000.f/(float)r_maxfps) : 0;
} }
else if (!Bstrcasecmp(parm->name, "r_ambientlight")) else if (!Bstrcasecmp(parm->name, "r_ambientlight"))