Fix pathfinding again
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) && x != target.x && y != target.y)
|
||||
if (bzTileMapHasAnyCollision(map, x, y) && (x != target.x || y != target.y))
|
||||
continue;
|
||||
PathNodeRecord *curRecord = &closedSet[y * map->width + x];
|
||||
if (curRecord->visited)
|
||||
@@ -265,7 +265,7 @@ bool pathfindAStar(const PathfindingDesc *desc) {
|
||||
}
|
||||
|
||||
reversePath(pathData);
|
||||
if (pathLen > 2)
|
||||
if (false && pathLen > 2)
|
||||
smoothPath(map, pathData, desc->pool);
|
||||
*desc->outPath = (Path) {pathData, 0};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user