1
0
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:
Ivan Savenko 2024-10-02 09:24:53 +00:00
parent cef7466c71
commit 5aebc83bca

View File

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