Fix #6598: Prevent invalid memory accesses when abandoning a join from within a network game

One could join a network game from within an already running network game. This would call a NetworkDisconnect, but keeps the UI alive. If, during that process the join is aborted, e.g. by cancelling on a password dialog, you would still be in your network game but also get shown the server list.
Solve all the underlying problems by falling back to the main UI when (re)connecting to a(nother) server.
This commit is contained in:
rubidium42
2021-05-01 14:41:25 +02:00
committed by rubidium42
parent 83985fe26f
commit 05394d5216
5 changed files with 32 additions and 4 deletions

View File

@@ -1068,6 +1068,11 @@ void SwitchToMode(SwitchMode new_mode)
break;
}
case SM_JOIN_GAME: // Join a multiplayer game
LoadIntroGame();
NetworkClientJoinGame();
break;
case SM_MENU: // Switch to game intro menu
LoadIntroGame();
if (BaseSounds::ini_set.empty() && BaseSounds::GetUsedSet()->fallback && SoundDriver::GetInstance()->HasOutput()) {