From 59059321a6276890e4a14841957f6838fab342f1 Mon Sep 17 00:00:00 2001 From: diath Date: Sat, 13 Jun 2020 09:00:01 +0200 Subject: [PATCH] Fix an issue with pathfinding not respecting the PathFindAllowCreatures flag properly (#1090) --- src/client/map.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/map.cpp b/src/client/map.cpp index 0a7e6cb63..461cefbf0 100644 --- a/src/client/map.cpp +++ b/src/client/map.cpp @@ -751,7 +751,7 @@ std::tuple, Otc::PathFindResult> Map::findPath(const // check the goal pos is walkable if(g_map.isAwareOfPosition(goalPos)) { const TilePtr goalTile = getTile(goalPos); - if(!goalTile || !goalTile->isWalkable()) { + if(!goalTile || !goalTile->isWalkable((flags & Otc::PathFindAllowCreatures))) { return ret; } } @@ -799,7 +799,7 @@ std::tuple, Otc::PathFindResult> Map::findPath(const wasSeen = true; if(const TilePtr& tile = getTile(neighborPos)) { hasCreature = tile->hasCreature(); - isNotWalkable = !tile->isWalkable(); + isNotWalkable = !tile->isWalkable((flags & Otc::PathFindAllowCreatures)); isNotPathable = !tile->isPathable(); speed = tile->getGroundSpeed(); }