From 5aebc83bca8ed181e0af1a901c97fd869cefb6f2 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 2 Oct 2024 09:24:53 +0000 Subject: [PATCH] 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 --- lib/CGameInfoCallback.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CGameInfoCallback.cpp b/lib/CGameInfoCallback.cpp index de5a77433..8e404e34c 100644 --- a/lib/CGameInfoCallback.cpp +++ b/lib/CGameInfoCallback.cpp @@ -964,7 +964,7 @@ std::vector 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; }