diff --git a/Source/Client/Networking/State/ClientJoiningState.cs b/Source/Client/Networking/State/ClientJoiningState.cs index 1e8a98d3..560a3b6d 100644 --- a/Source/Client/Networking/State/ClientJoiningState.cs +++ b/Source/Client/Networking/State/ClientJoiningState.cs @@ -127,6 +127,16 @@ void StartDownloading() { if (bootstrapState is { Enabled: true } state) { + var connectingWindows = Find.WindowStack.Windows + .OfType() + .ToList(); + + foreach (var connectingWindow in connectingWindows) + { + connectingWindow.suppressPostCloseActions = true; + Find.WindowStack.TryRemove(connectingWindow); + } + connection.ChangeState(ConnectionStateEnum.ClientBootstrap); Find.WindowStack.Add(new BootstrapConfiguratorWindow(connection, state)); return; diff --git a/Source/Client/Windows/ConnectingWindow.cs b/Source/Client/Windows/ConnectingWindow.cs index 11aef761..1e05e0e3 100644 --- a/Source/Client/Windows/ConnectingWindow.cs +++ b/Source/Client/Windows/ConnectingWindow.cs @@ -14,6 +14,7 @@ public abstract class BaseConnectingWindow : Window, IConnectionStatusListener protected abstract string ConnectingString { get; } public bool returnToServerBrowser; + public bool suppressPostCloseActions; protected string result; // Only show this window if there aren't any others during connecting @@ -117,6 +118,9 @@ public override void DoWindowContents(Rect inRect) public override void PostClose() { + if (suppressPostCloseActions) + return; + Multiplayer.StopMultiplayer(); if (returnToServerBrowser)