mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-14 10:12:59 +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:
parent
cef7466c71
commit
5aebc83bca
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user