From df1687c5c7d3efc46e49ca0031ea9e2de62bdb98 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Tue, 21 Jun 2011 11:29:31 +0000 Subject: [PATCH] Fix unnoticed bug in game_restart --- code/client/cl_main.c | 6 +++--- code/client/cl_parse.c | 3 +++ code/client/client.h | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/code/client/cl_main.c b/code/client/cl_main.c index 804e9a95..67c6745c 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -1223,11 +1223,10 @@ static void CL_UpdateGUID( const char *prefix, int prefix_len ) static void CL_OldGame(void) { - char *curGame = Cvar_VariableString("fs_game"); - - if(cls.oldGame[0] || *curGame) + if(cls.oldGameSet) { // change back to previous fs_game + cls.oldGameSet = qfalse; Cvar_Set("fs_game", cls.oldGame); Com_GameRestart(0, qtrue); } @@ -3160,6 +3159,7 @@ void CL_Init( void ) { { CL_ClearState(); clc.state = CA_DISCONNECTED; // no longer CA_UNINITIALIZED + cls.oldGameSet = qfalse; } cls.realtime = 0; diff --git a/code/client/cl_parse.c b/code/client/cl_parse.c index 315aa943..1f672198 100644 --- a/code/client/cl_parse.c +++ b/code/client/cl_parse.c @@ -534,7 +534,10 @@ void CL_ParseGamestate( msg_t *msg ) { // reinitialize the filesystem if the game directory has changed if(FS_ConditionalRestart(clc.checksumFeed, qfalse) && !cls.oldGame[0]) + { + cls.oldGameSet = qtrue; Q_strncpyz(cls.oldGame, oldGame, sizeof(cls.oldGame)); + } // This used to call CL_StartHunkUsers, but now we enter the download state before loading the // cgame diff --git a/code/client/client.h b/code/client/client.h index 53a5bb5b..533696fd 100644 --- a/code/client/client.h +++ b/code/client/client.h @@ -334,6 +334,7 @@ typedef struct { int pingUpdateSource; // source currently pinging or updating char oldGame[MAX_QPATH]; + qboolean oldGameSet; // update server info netadr_t updateServer;