From 38a2f4d9384d8b58996377804ee4c65b495b47ed Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 10 Jun 2018 15:13:04 -0500 Subject: [PATCH] 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. --- code/sys/sys_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/sys/sys_main.c b/code/sys/sys_main.c index 0598f293..40b07e5d 100644 --- a/code/sys/sys_main.c +++ b/code/sys/sys_main.c @@ -112,6 +112,14 @@ Restart the input subsystem */ 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( ); }