mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fix hotseat
This commit is contained in:
parent
0a0c01d639
commit
42030ed10f
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user