Skip to content

Commit

Permalink
Fix an issue with pathfinding not respecting the PathFindAllowCreatur…
Browse files Browse the repository at this point in the history
…es flag properly (#1090)
  • Loading branch information
diath authored Jun 13, 2020
1 parent b0a73e5 commit 5905932
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ std::tuple<std::vector<Otc::Direction>, 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;
}
}
Expand Down Expand Up @@ -799,7 +799,7 @@ std::tuple<std::vector<Otc::Direction>, 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();
}
Expand Down

0 comments on commit 5905932

Please sign in to comment.