diff --git a/code/game/g_main.c b/code/game/g_main.c index 0267de46..63e93e07 100644 --- a/code/game/g_main.c +++ b/code/game/g_main.c @@ -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\"");