mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-15 20:03:15 +02:00
Fix UI lock on ending turn while simturns are active
This commit is contained in:
@@ -467,6 +467,18 @@ void AdventureMapInterface::hotkeyEndingTurn()
|
|||||||
LOCPLINT->cb->endTurn();
|
LOCPLINT->cb->endTurn();
|
||||||
|
|
||||||
mapAudio->onPlayerTurnEnded();
|
mapAudio->onPlayerTurnEnded();
|
||||||
|
|
||||||
|
// Normally, game will receive PlayerStartsTurn call almost instantly with new player ID that will switch UI to waiting mode
|
||||||
|
// However, when simturns are active it is possible for such call not to come because another player is still acting
|
||||||
|
// So find first player other than ours that is acting at the moment and update UI as if he had started turn
|
||||||
|
for (auto player = PlayerColor(0); player < PlayerColor::PLAYER_LIMIT; ++player)
|
||||||
|
{
|
||||||
|
if (player != LOCPLINT->playerID && LOCPLINT->cb->isPlayerMakingTurn(player))
|
||||||
|
{
|
||||||
|
onEnemyTurnStarted(player, LOCPLINT->cb->getStartInfo()->playerInfos.at(player).isControlledByHuman());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const CGObjectInstance* AdventureMapInterface::getActiveObject(const int3 &mapPos)
|
const CGObjectInstance* AdventureMapInterface::getActiveObject(const int3 &mapPos)
|
||||||
|
Reference in New Issue
Block a user