mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-29 07:11:44 +00:00
Fix timelimit causing an infinite map ending loop
A negative timelimit value or a value that would overflow the multiplication by 60000 caused an endless map change/reload. Based on patch and description by @vloup.
This commit is contained in:
parent
83119a990a
commit
0822772ea2
1 changed files with 6 additions and 0 deletions
|
@ -1366,6 +1366,12 @@ void CheckExitRules( void ) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ( g_timelimit.integer < 0 || g_timelimit.integer > INT_MAX / 60000 ) {
|
||||
G_Printf( "timelimit %i is out of range, defaulting to 0\n", g_timelimit.integer );
|
||||
trap_Cvar_Set( "timelimit", "0" );
|
||||
trap_Cvar_Update( &g_timelimit );
|
||||
}
|
||||
|
||||
if ( g_timelimit.integer && !level.warmupTime ) {
|
||||
if ( level.time - level.startTime >= g_timelimit.integer*60000 ) {
|
||||
trap_SendServerCommand( -1, "print \"Timelimit hit.\n\"");
|
||||
|
|
Loading…
Reference in a new issue