Fix pathfinding when target is slightly inside collider
This commit is contained in:
@@ -192,7 +192,7 @@ bool pathfindAStar(const PathfindingDesc *desc) {
|
||||
x < 0 || x >= map->width)
|
||||
continue;
|
||||
// not walkable
|
||||
if (bzTileMapHasAnyCollision(map, x, y))
|
||||
if (bzTileMapHasAnyCollision(map, x, y) && x != target.x && y != target.y)
|
||||
continue;
|
||||
PathNodeRecord *curRecord = &closedSet[y * map->width + x];
|
||||
if (curRecord->visited)
|
||||
|
||||
Reference in New Issue
Block a user