mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-29 21:56:54 +02:00
Fix crash on starting map as non-red player
This commit is contained in:
parent
97097c20ad
commit
71ad9d6707
@ -166,8 +166,9 @@ void CPlayerInterface::initGameInterface(std::shared_ptr<Environment> ENV, std::
|
|||||||
env = ENV;
|
env = ENV;
|
||||||
|
|
||||||
CCS->musich->loadTerrainMusicThemes();
|
CCS->musich->loadTerrainMusicThemes();
|
||||||
|
|
||||||
initializeHeroTownList();
|
initializeHeroTownList();
|
||||||
|
|
||||||
|
adventureInt.reset(new AdventureMapInterface());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlayerInterface::playerEndsTurn(PlayerColor player)
|
void CPlayerInterface::playerEndsTurn(PlayerColor player)
|
||||||
@ -207,9 +208,6 @@ void CPlayerInterface::playerStartsTurn(PlayerColor player)
|
|||||||
if(GH.windows().findWindows<AdventureMapInterface>().empty())
|
if(GH.windows().findWindows<AdventureMapInterface>().empty())
|
||||||
{
|
{
|
||||||
// after map load - remove all active windows and replace them with adventure map
|
// 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().clear();
|
||||||
GH.windows().pushWindow(adventureInt);
|
GH.windows().pushWindow(adventureInt);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user