Fixed pathfinding bug