mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Code style: avoid some ambiguous else if indentation
If some code intentionally want to break else if to achieve specific indentation there must be braces.
This commit is contained in:
parent
6d9f99d4de
commit
cdd9dbc7f1
@ -1006,13 +1006,17 @@ TGoalVec Conquer::getAllPossibleSubgoals()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(obj->ID.num == Obj::HERO) //enemy hero may move to other position
|
if(obj->ID.num == Obj::HERO) //enemy hero may move to other position
|
||||||
|
{
|
||||||
ret.push_back(sptr(Goals::VisitHero(obj->id.getNum()).sethero(h).setisAbstract(true)));
|
ret.push_back(sptr(Goals::VisitHero(obj->id.getNum()).sethero(h).setisAbstract(true)));
|
||||||
|
}
|
||||||
else //just visit that tile
|
else //just visit that tile
|
||||||
|
{
|
||||||
if(obj->ID.num == Obj::TOWN)
|
if(obj->ID.num == Obj::TOWN)
|
||||||
//if target is town, fuzzy system will use additional "estimatedReward" variable to increase priority a bit
|
//if target is town, fuzzy system will use additional "estimatedReward" variable to increase priority a bit
|
||||||
ret.push_back(sptr(Goals::VisitTile(dest).sethero(h).setobjid(obj->ID.num).setisAbstract(true))); //TODO: change to getObj eventually and and move appropiate logic there
|
ret.push_back(sptr(Goals::VisitTile(dest).sethero(h).setobjid(obj->ID.num).setisAbstract(true))); //TODO: change to getObj eventually and and move appropiate logic there
|
||||||
else
|
else
|
||||||
ret.push_back(sptr(Goals::VisitTile(dest).sethero(h).setisAbstract(true)));
|
ret.push_back(sptr(Goals::VisitTile(dest).sethero(h).setisAbstract(true)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else //we need to get army in order to conquer that place
|
else //we need to get army in order to conquer that place
|
||||||
|
@ -129,8 +129,10 @@ void CZonePlacer::placeZones(const CMapGenOptions * mapGenOptions, CRandomGenera
|
|||||||
improvement = true;
|
improvement = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
if (totalDistance + totalOverlap < bestTotalDistance + bestTotalOverlap)
|
if (totalDistance + totalOverlap < bestTotalDistance + bestTotalOverlap)
|
||||||
improvement = true;
|
improvement = true;
|
||||||
|
}
|
||||||
|
|
||||||
logGlobal->traceStream() << boost::format("Total distance between zones after this iteration: %2.4f, Total overlap: %2.4f, Improved: %s") % totalDistance % totalOverlap % improvement;
|
logGlobal->traceStream() << boost::format("Total distance between zones after this iteration: %2.4f, Total overlap: %2.4f, Improved: %s") % totalDistance % totalOverlap % improvement;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user