From 71ad9d670747f68c1ed05d3ca93bffa548fda82c Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 27 Sep 2023 21:23:54 +0300 Subject: [PATCH] Fix crash on starting map as non-red player --- client/CPlayerInterface.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 09bdc174f..29b23c448 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -166,8 +166,9 @@ void CPlayerInterface::initGameInterface(std::shared_ptr ENV, std:: env = ENV; CCS->musich->loadTerrainMusicThemes(); - initializeHeroTownList(); + + adventureInt.reset(new AdventureMapInterface()); } void CPlayerInterface::playerEndsTurn(PlayerColor player) @@ -207,9 +208,6 @@ 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); }