1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Avoid boost::optional assignment for Boost 1.64 compatibility (#360)

Two options here: to use emplace from 1.56 or boost::make_optional.
Unfortunately Ubuntu 14.04 is using 1.54 and I'd rather not to break it.
This commit is contained in:
ArseniyShestakov
2017-08-05 16:09:29 +03:00
committed by GitHub
parent 4388e12a3a
commit cb40c093f8
12 changed files with 21 additions and 19 deletions

View File

@@ -579,7 +579,7 @@ void CGameHandler::endBattle(int3 tile, const CGHeroInstance *hero1, const CGHer
if (battleQuery != queries.topQuery(gs->curB->sides[0].color))
complain("Player " + boost::lexical_cast<std::string>(gs->curB->sides[0].color) + " although in battle has no battle query at the top!");
battleQuery->result = *battleResult.data;
battleQuery->result = boost::make_optional(*battleResult.data);
//Check how many battle queries were created (number of players blocked by battle)
const int queriedPlayers = battleQuery ? boost::count(queries.allQueries(), battleQuery) : 0;
@@ -2120,7 +2120,7 @@ bool CGameHandler::moveHero(ObjectInstanceID hid, int3 dst, ui8 teleporting, boo
}
else if (lookForGuards == CHECK_FOR_GUARDS && this->isInTheMap(guardPos))
{
tmh.attackedFrom = guardPos;
tmh.attackedFrom = boost::make_optional(guardPos);
const TerrainTile &guardTile = *gs->getTile(guardPos);
objectVisited(guardTile.visitableObjects.back(), h);