mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Fixed AI getting stuck at blockVisit objects (Tavern, Borderguards/gates etc).
This commit is contained in:
@@ -400,11 +400,19 @@ int3 whereToExplore(HeroPtr h)
|
||||
}
|
||||
}
|
||||
|
||||
bool isBlockedBorderGate(int3 tileToHit)
|
||||
bool isBlockedBorderGate(int3 tileToHit) //TODO: is that function needed? should be handled by pathfinder
|
||||
{
|
||||
return cb->getTile(tileToHit)->topVisitableId() == Obj::BORDER_GATE &&
|
||||
(dynamic_cast <const CGKeys *>(cb->getTile(tileToHit)->visitableObjects.back()))->wasMyColorVisited (ai->playerID);
|
||||
}
|
||||
bool isBlockVisitObj(const int3 &pos)
|
||||
{
|
||||
if (auto obj = cb->getTopObj(pos))
|
||||
if (obj->blockVisit) //we can't stand on that object
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int howManyTilesWillBeDiscovered(const int3 &pos, int radious, CCallback * cbp)
|
||||
{ //TODO: do not explore dead-end boundaries
|
||||
|
||||
Reference in New Issue
Block a user