mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-29 21:56:54 +02:00
Few more uses of cached visibleTiles.
This commit is contained in:
parent
63ca9202e4
commit
4e444abf66
@ -3220,7 +3220,7 @@ For ship construction etc, another function (goal?) is needed
|
|||||||
//embark on ship -> look for an EP with a boat
|
//embark on ship -> look for an EP with a boat
|
||||||
auto firstEP = boost::find_if(src->embarkmentPoints, [=](crint3 pos) -> bool
|
auto firstEP = boost::find_if(src->embarkmentPoints, [=](crint3 pos) -> bool
|
||||||
{
|
{
|
||||||
const TerrainTile *t = cb->getTile(pos);
|
const TerrainTile *t = getTile(pos);
|
||||||
return t && t->visitableObjects.size() == 1 && t->topVisitableId() == Obj::BOAT
|
return t && t->visitableObjects.size() == 1 && t->topVisitableId() == Obj::BOAT
|
||||||
&& retreiveTile(pos) == sectorToReach->id;
|
&& retreiveTile(pos) == sectorToReach->id;
|
||||||
});
|
});
|
||||||
@ -3310,7 +3310,7 @@ For ship construction etc, another function (goal?) is needed
|
|||||||
{
|
{
|
||||||
//make sure no hero block the way
|
//make sure no hero block the way
|
||||||
auto pos = ai->knownSubterraneanGates[gate]->visitablePos();
|
auto pos = ai->knownSubterraneanGates[gate]->visitablePos();
|
||||||
const TerrainTile *t = cb->getTile(pos);
|
const TerrainTile *t = getTile(pos);
|
||||||
return t && t->visitableObjects.size() == 1 && t->topVisitableId() == Obj::SUBTERRANEAN_GATE
|
return t && t->visitableObjects.size() == 1 && t->topVisitableId() == Obj::SUBTERRANEAN_GATE
|
||||||
&& retreiveTile(pos) == sectorToReach->id;
|
&& retreiveTile(pos) == sectorToReach->id;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user