mirror of
https://github.com/edubart/otclient.git
synced 2025-06-15 23:04:28 +02:00
Fix an issue with pathfinding not respecting the PathFindAllowCreatures flag properly (#1090)
This commit is contained in:
parent
b0a73e5525
commit
59059321a6
@ -751,7 +751,7 @@ std::tuple<std::vector<Otc::Direction>, Otc::PathFindResult> Map::findPath(const
|
|||||||
// check the goal pos is walkable
|
// check the goal pos is walkable
|
||||||
if(g_map.isAwareOfPosition(goalPos)) {
|
if(g_map.isAwareOfPosition(goalPos)) {
|
||||||
const TilePtr goalTile = getTile(goalPos);
|
const TilePtr goalTile = getTile(goalPos);
|
||||||
if(!goalTile || !goalTile->isWalkable()) {
|
if(!goalTile || !goalTile->isWalkable((flags & Otc::PathFindAllowCreatures))) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -799,7 +799,7 @@ std::tuple<std::vector<Otc::Direction>, Otc::PathFindResult> Map::findPath(const
|
|||||||
wasSeen = true;
|
wasSeen = true;
|
||||||
if(const TilePtr& tile = getTile(neighborPos)) {
|
if(const TilePtr& tile = getTile(neighborPos)) {
|
||||||
hasCreature = tile->hasCreature();
|
hasCreature = tile->hasCreature();
|
||||||
isNotWalkable = !tile->isWalkable();
|
isNotWalkable = !tile->isWalkable((flags & Otc::PathFindAllowCreatures));
|
||||||
isNotPathable = !tile->isPathable();
|
isNotPathable = !tile->isPathable();
|
||||||
speed = tile->getGroundSpeed();
|
speed = tile->getGroundSpeed();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user