1
0
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:
ArseniyShestakov
2015-11-12 01:16:06 +03:00
parent d76b2b7ca8
commit 942c0cd718

View File

@@ -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());
}
}