1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Merge pull request #5295 from IvanSavenko/bugfixing

[1.6.4] Bugfixing for recently reported issues
This commit is contained in:
Ivan Savenko
2025-01-21 15:50:02 +02:00
committed by GitHub
23 changed files with 135 additions and 96 deletions

View File

@@ -3517,8 +3517,6 @@ void CGameHandler::checkVictoryLossConditionsForPlayer(PlayerColor player)
addStatistics(peg.statistic); // add last turn befor win / loss
sendAndApply(peg);
turnOrder->onPlayerEndsGame(player);
if (victoryLossCheckResult.victory())
{
//one player won -> all enemies lost
@@ -3546,6 +3544,9 @@ void CGameHandler::checkVictoryLossConditionsForPlayer(PlayerColor player)
}
else
{
// give turn to next player(s)
turnOrder->onPlayerEndsGame(player);
//copy heroes vector to avoid iterator invalidation as removal change PlayerState
auto hlp = p->getHeroes();
for (auto h : hlp) //eliminate heroes