Fix in_restart causing fatal error while video is shutdown

Connecting to a server running a different fs_game and using a
autoexec.cfg containing in_restart would hit a fatal error in IN_Init().

    IN_Init called before SDL_Init( SDL_INIT_VIDEO )

Reported by smokey2k on the ioquake3 forum.
This commit is contained in:
Zack Middleton 2018-06-10 15:13:04 -05:00
parent 1b1d0c55f6
commit 38a2f4d938
1 changed files with 8 additions and 0 deletions

View File

@ -112,6 +112,14 @@ Restart the input subsystem
*/ */
void Sys_In_Restart_f( void ) void Sys_In_Restart_f( void )
{ {
#ifndef DEDICATED
if( !SDL_WasInit( SDL_INIT_VIDEO ) )
{
Com_Printf( "in_restart: Cannot restart input while video is shutdown\n" );
return;
}
#endif
IN_Restart( ); IN_Restart( );
} }