From 42030ed10fa42f7966f70294f9698a26b1660ca5 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 26 Sep 2023 17:28:50 +0300 Subject: [PATCH] Fix hotseat --- client/CPlayerInterface.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 23e2240e0..3be85d404 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -167,16 +167,6 @@ void CPlayerInterface::initGameInterface(std::shared_ptr ENV, std:: CCS->musich->loadTerrainMusicThemes(); initializeHeroTownList(); - - // always recreate advmap interface to avoid possible memory-corruption bugs - adventureInt.reset(new AdventureMapInterface()); - - if(GH.windows().findWindows().empty()) - { - // after map load - remove all active windows and replace them with adventure map - GH.windows().clear(); - GH.windows().pushWindow(adventureInt); - } } void CPlayerInterface::playerEndsTurn(PlayerColor player) @@ -213,6 +203,16 @@ void CPlayerInterface::playerEndsTurn(PlayerColor player) void CPlayerInterface::playerStartsTurn(PlayerColor player) { + if(GH.windows().findWindows().empty()) + { + // after map load - remove all active windows and replace them with adventure map + // always recreate advmap interface to avoid possible memory-corruption bugs + adventureInt.reset(new AdventureMapInterface()); + + GH.windows().clear(); + GH.windows().pushWindow(adventureInt); + } + EVENT_HANDLER_CALLED_BY_CLIENT; if (player != playerID && LOCPLINT == this) {