mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-10 22:31:40 +02:00
Fixes pathfinding via subterranean gates located on right edge of map
In this case, 'pos' is actually outside of map borders, so never visible to a player
This commit is contained in:
@@ -964,7 +964,7 @@ std::vector<ObjectInstanceID> CGameInfoCallback::getVisibleTeleportObjects(std::
|
||||
vstd::erase_if(ids, [&](const ObjectInstanceID & id) -> bool
|
||||
{
|
||||
const auto * obj = getObj(id, false);
|
||||
return player != PlayerColor::UNFLAGGABLE && (!obj || !isVisible(obj->pos, player));
|
||||
return player != PlayerColor::UNFLAGGABLE && (!obj || !isVisible(obj->visitablePos(), player));
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
|
Reference in New Issue
Block a user