1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-21 21:17:49 +02:00

Fix crash on starting map as non-red player

This commit is contained in:
Ivan Savenko 2023-09-27 21:23:54 +03:00
parent 97097c20ad
commit 71ad9d6707

View File

@ -166,8 +166,9 @@ void CPlayerInterface::initGameInterface(std::shared_ptr<Environment> 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<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);
}