Fix unnoticed bug in game_restart
This commit is contained in:
parent
dee3724a13
commit
df1687c5c7
3 changed files with 7 additions and 3 deletions
|
@ -1223,11 +1223,10 @@ static void CL_UpdateGUID( const char *prefix, int prefix_len )
|
||||||
|
|
||||||
static void CL_OldGame(void)
|
static void CL_OldGame(void)
|
||||||
{
|
{
|
||||||
char *curGame = Cvar_VariableString("fs_game");
|
if(cls.oldGameSet)
|
||||||
|
|
||||||
if(cls.oldGame[0] || *curGame)
|
|
||||||
{
|
{
|
||||||
// change back to previous fs_game
|
// change back to previous fs_game
|
||||||
|
cls.oldGameSet = qfalse;
|
||||||
Cvar_Set("fs_game", cls.oldGame);
|
Cvar_Set("fs_game", cls.oldGame);
|
||||||
Com_GameRestart(0, qtrue);
|
Com_GameRestart(0, qtrue);
|
||||||
}
|
}
|
||||||
|
@ -3160,6 +3159,7 @@ void CL_Init( void ) {
|
||||||
{
|
{
|
||||||
CL_ClearState();
|
CL_ClearState();
|
||||||
clc.state = CA_DISCONNECTED; // no longer CA_UNINITIALIZED
|
clc.state = CA_DISCONNECTED; // no longer CA_UNINITIALIZED
|
||||||
|
cls.oldGameSet = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
cls.realtime = 0;
|
cls.realtime = 0;
|
||||||
|
|
|
@ -534,7 +534,10 @@ void CL_ParseGamestate( msg_t *msg ) {
|
||||||
|
|
||||||
// reinitialize the filesystem if the game directory has changed
|
// reinitialize the filesystem if the game directory has changed
|
||||||
if(FS_ConditionalRestart(clc.checksumFeed, qfalse) && !cls.oldGame[0])
|
if(FS_ConditionalRestart(clc.checksumFeed, qfalse) && !cls.oldGame[0])
|
||||||
|
{
|
||||||
|
cls.oldGameSet = qtrue;
|
||||||
Q_strncpyz(cls.oldGame, oldGame, sizeof(cls.oldGame));
|
Q_strncpyz(cls.oldGame, oldGame, sizeof(cls.oldGame));
|
||||||
|
}
|
||||||
|
|
||||||
// This used to call CL_StartHunkUsers, but now we enter the download state before loading the
|
// This used to call CL_StartHunkUsers, but now we enter the download state before loading the
|
||||||
// cgame
|
// cgame
|
||||||
|
|
|
@ -334,6 +334,7 @@ typedef struct {
|
||||||
int pingUpdateSource; // source currently pinging or updating
|
int pingUpdateSource; // source currently pinging or updating
|
||||||
|
|
||||||
char oldGame[MAX_QPATH];
|
char oldGame[MAX_QPATH];
|
||||||
|
qboolean oldGameSet;
|
||||||
|
|
||||||
// update server info
|
// update server info
|
||||||
netadr_t updateServer;
|
netadr_t updateServer;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue