Browse Source

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
Ivan Savenko 1 year ago
parent
commit
5aebc83bca
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/CGameInfoCallback.cpp

+ 1 - 1
lib/CGameInfoCallback.cpp

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