From f28c4c4b4e39ca80cdc48b16e54c6e64bc165ca7 Mon Sep 17 00:00:00 2001 From: Lev Date: Fri, 30 Dec 2016 00:31:45 +0500 Subject: [PATCH] Fixed Host_Quit_Restart_f. --- rehlds/engine/host_cmd.cpp | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/rehlds/engine/host_cmd.cpp b/rehlds/engine/host_cmd.cpp index 8d01a62..bd329a2 100644 --- a/rehlds/engine/host_cmd.cpp +++ b/rehlds/engine/host_cmd.cpp @@ -498,25 +498,20 @@ 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) + { + if (g_psvs.maxclients == 1 && g_pcls.state == ca_active && g_pPostRestartCmdLineArgs) + { + Cbuf_AddText("save quick\n"); + Cbuf_Execute(); + Q_strcat(g_pPostRestartCmdLineArgs, " +load quick"); + } + } + else if (g_pcls.state == ca_active && g_pcls.trueaddress[0] && g_pPostRestartCmdLineArgs) { Q_strcat(g_pPostRestartCmdLineArgs, " +connect "); Q_strcat(g_pPostRestartCmdLineArgs, g_pcls.servername); } - else - { - if (g_psvs.maxclients == 1 && g_pcls.state == ca_active) - { - if (g_pPostRestartCmdLineArgs) - { - Cbuf_AddText("save quick\n"); - Cbuf_Execute(); - - Q_strcat(g_pPostRestartCmdLineArgs, " +load quick"); - } - } - - } } void Host_Status_Printf(qboolean conprint, qboolean log, char *fmt, ...) @@ -880,7 +875,7 @@ void Host_Map_f(void) if (careerState == CAREER_LOADING) g_careerState = CAREER_LOADING; - if (COM_CheckParm("-steam") && PF_IsDedicatedServer()) + if (COM_CheckParm("-steam") && PF_IsDedicatedServer()) g_bMajorMapChange = TRUE; FS_LogLevelLoadStarted("Map_Common"); @@ -1373,7 +1368,7 @@ void Host_Savegame_f(void) Con_DPrintf("Relative pathnames are not allowed.\n"); return; } - g_pSaveGameCommentFunc(szTemp, 80); + g_pSaveGameCommentFunc(szTemp, 80); Q_snprintf(szComment, sizeof(szComment) - 1,"%-64.64s %02d:%02d", szTemp, (int)(g_psv.time / 60.0), (int)fmod(g_psv.time, 60.0)); SaveGameSlot(Cmd_Argv(1), szComment); CL_HudMessage("GAMESAVED"); @@ -1809,8 +1804,8 @@ SAVERESTOREDATA *LoadSaveData(const char *level) pSaveData->vecLandmarkOffset[2] = 0.0f; gGlobalVariables.pSaveData = pSaveData; - FS_Read(pSaveData->pBaseData, size, 1, pFile); - FS_Close(pFile); + FS_Read(pSaveData->pBaseData, size, 1, pFile); + FS_Close(pFile); return pSaveData; }