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

initializer lists part1

This commit is contained in:
AlexVinS
2014-10-02 19:43:46 +04:00
parent 463b9e46b3
commit 66b022f93e
20 changed files with 285 additions and 222 deletions

View File

@@ -704,7 +704,7 @@ void CGameHandler::battleAfterLevelUp( const BattleResult &result )
visitObjectAfterVictory = false;
//handle victory/loss of engaged players
std::set<PlayerColor> playerColors = boost::assign::list_of(finishingBattle->loser)(finishingBattle->victor);
std::set<PlayerColor> playerColors = {finishingBattle->loser, finishingBattle->victor};
checkVictoryLossConditions(playerColors);
if(result.result == BattleResult::SURRENDER || result.result == BattleResult::ESCAPE) //loser has escaped or surrendered
@@ -1819,7 +1819,7 @@ void CGameHandler::setOwner(const CGObjectInstance * obj, PlayerColor owner)
SetObjectProperty sop(obj->id, 1, owner.getNum());
sendAndApply(&sop);
std::set<PlayerColor> playerColors = boost::assign::list_of(owner)(oldOwner);
std::set<PlayerColor> playerColors = {owner, oldOwner};
checkVictoryLossConditions(playerColors);
if(owner < PlayerColor::PLAYER_LIMIT && dynamic_cast<const CGTownInstance *>(obj)) //town captured