From 500b43cd70e771db44928ffa2fba13894c05b79b Mon Sep 17 00:00:00 2001 From: Chuvi Date: Thu, 29 Dec 2016 02:23:43 +0300 Subject: [PATCH] Fixed condition in Host_Quit_Restart_f (This doesn't fix crash when using _restart command in hlds.exe, but at least it fix crash in Host_Quit_Restart_f) --- rehlds/engine/host_cmd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rehlds/engine/host_cmd.cpp b/rehlds/engine/host_cmd.cpp index 9ac9e67..50bf385 100644 --- a/rehlds/engine/host_cmd.cpp +++ b/rehlds/engine/host_cmd.cpp @@ -41,7 +41,7 @@ int gHostSpawnCount; qboolean g_bMajorMapChange; int g_iQuitCommandIssued; -char *g_pPostRestartCmdLineArgs; +char *g_pPostRestartCmdLineArgs=NULL; /* * Globals initialization @@ -498,7 +498,7 @@ void Host_Quit_Restart_f(void) giActive = DLL_RESTART; giStateInfo = 4; - if (g_psv.active || (g_pcls.state == ca_active && g_pcls.trueaddress[0] && g_pPostRestartCmdLineArgs)) + if ((g_psv.active || (g_pcls.state == ca_active && g_pcls.trueaddress[0])) && g_pPostRestartCmdLineArgs) { Q_strcat(g_pPostRestartCmdLineArgs, " +connect "); Q_strcat(g_pPostRestartCmdLineArgs, g_pcls.servername);