瀏覽代碼

Fix hotseat

Ivan Savenko 2 年之前
父節點
當前提交
42030ed10f
共有 1 個文件被更改,包括 10 次插入10 次删除
  1. 10 10
      client/CPlayerInterface.cpp

+ 10 - 10
client/CPlayerInterface.cpp

@@ -167,16 +167,6 @@ void CPlayerInterface::initGameInterface(std::shared_ptr<Environment> ENV, std::
 	CCS->musich->loadTerrainMusicThemes();
 
 	initializeHeroTownList();
-
-	// always recreate advmap interface to avoid possible memory-corruption bugs
-	adventureInt.reset(new AdventureMapInterface());
-
-	if(GH.windows().findWindows<AdventureMapInterface>().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<AdventureMapInterface>().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)
 	{