diff --git a/Assets/_Project/Scripts/UI/HUDController.cs b/Assets/_Project/Scripts/UI/HUDController.cs index 450e0f9..9ff9ca4 100644 --- a/Assets/_Project/Scripts/UI/HUDController.cs +++ b/Assets/_Project/Scripts/UI/HUDController.cs @@ -2169,10 +2169,22 @@ namespace TD.UI // Fallback: LobbyService isn't spawned (e.g. testing the gameplay // scene standalone without the lobby flow). Hard-reload the scene. - Debug.LogWarning("[HUDController] LobbyService not found — falling back to scene reload."); + // + // Do NOT reload via NetworkManager.SceneManager here. Reloading the + // currently-active scene through NGO's networked scene manager in + // Single mode deadlocks: SceneEventProgress unloads the active scene + // then waits on a load-complete ack for the same scene handle it is + // mid-transition on, which never arrives — the main thread hangs + // (beachball). LoadSceneAsHost is safe only because it loads a + // *different* scene (Lobby). With no LobbyService there is no real + // multiplayer session worth preserving, so shut the host down and do + // a plain, non-networked Unity scene reload instead. + Debug.LogWarning("[HUDController] LobbyService not found — falling back to non-networked scene reload."); + string activeScene = SceneManager.GetActiveScene().name; var nm = NetworkManager.Singleton; - if (nm != null && nm.IsServer && nm.SceneManager != null) - nm.SceneManager.LoadScene(SceneManager.GetActiveScene().name, LoadSceneMode.Single); + if (nm != null && nm.IsListening) + nm.Shutdown(); + SceneManager.LoadScene(activeScene, LoadSceneMode.Single); } // Return to Main Menu: disconnect only this player. SessionFlow's