mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
CPathfinder: improve support for whirlpools
This commit is contained in:
@@ -248,7 +248,16 @@ void CPathfinder::addTeleportExits(bool noTeleportExcludes)
|
||||
for(auto objId : gs->getTeleportChannelExits(sTileTeleport->channel, hero->tempOwner))
|
||||
{
|
||||
auto obj = getObj(objId);
|
||||
if(CGTeleport::isExitPassable(gs, hero, obj))
|
||||
if(dynamic_cast<const CGWhirlpool *>(obj))
|
||||
{
|
||||
auto pos = obj->getBlockedPos();
|
||||
for(auto p : pos)
|
||||
{
|
||||
if(gs->getTile(p)->topVisitableId() == obj->ID)
|
||||
neighbours.push_back(p);
|
||||
}
|
||||
}
|
||||
else if(CGTeleport::isExitPassable(gs, hero, obj))
|
||||
neighbours.push_back(obj->visitablePos());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user