Skip to content

Commit

Permalink
engine: properly disconnect from online game when loading local game …
Browse files Browse the repository at this point in the history
…(save, newgame or a level)
  • Loading branch information
a1batross committed Jul 10, 2024
1 parent 0da7ffe commit 9b86c31
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions engine/common/host_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ void COM_NewGame( char const *pMapName )
GameState->loadGame = false;
GameState->newGame = true;

if( !SV_Active( ))
CL_Disconnect( ); // disconnect from current online game

SV_ShutdownGame(); // exit from current game
}

Expand All @@ -79,6 +82,9 @@ void COM_LoadLevel( char const *pMapName, qboolean background )
GameState->loadGame = false;
GameState->newGame = false;

if( !SV_Active( ))
CL_Disconnect( ); // disconnect from current online game

SV_ShutdownGame(); // exit from current game
}

Expand All @@ -95,6 +101,9 @@ void COM_LoadGame( char const *pMapName )
GameState->backgroundMap = false;
GameState->newGame = false;
GameState->loadGame = true;

if( !SV_Active( ))
CL_Disconnect( ); // disconnect from current online game
}

void COM_ChangeLevel( char const *pNewLevel, char const *pLandmarkName, qboolean background )
Expand Down

0 comments on commit 9b86c31

Please sign in to comment.