1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Final tweaks. Not going to add anything more to this PR.

This commit is contained in:
DJWarmonger 2018-07-26 18:02:15 +02:00
parent e5b979d4ad
commit 5ce4e784c9

View File

@ -1513,7 +1513,12 @@ void VCAI::wander(HeroPtr h)
auto compareReinforcements = [h](const CGTownInstance * lhs, const CGTownInstance * rhs) -> bool auto compareReinforcements = [h](const CGTownInstance * lhs, const CGTownInstance * rhs) -> bool
{ {
return howManyReinforcementsCanGet(h, lhs) < howManyReinforcementsCanGet(h, rhs); auto r1 = howManyReinforcementsCanGet(h, lhs),
r2 = howManyReinforcementsCanGet(h, rhs);
if (r1 != r2)
return r1 < r2;
else
return howManyReinforcementsCanBuy(h, lhs) < howManyReinforcementsCanBuy(h, rhs);
}; };
std::vector<const CGTownInstance *> townsReachable; std::vector<const CGTownInstance *> townsReachable;
@ -3340,7 +3345,7 @@ int3 SectorMap::firstTileToGet(HeroPtr h, crint3 dst)
if(sourceSector != destinationSector) //use ships, shipyards etc.. if(sourceSector != destinationSector) //use ships, shipyards etc..
{ {
if(ai->isAccessibleForHero(dst, h)) //pathfinder can find a way using ships and gates if tile is not blocked by objects if(ai->isAccessibleForHero(dst, h, true)) //pathfinder can find a way using ships and gates if tile is not blocked by objects
return dst; return dst;
std::map<const Sector *, const Sector *> preds; std::map<const Sector *, const Sector *> preds;