Skip to content

Commit

Permalink
Update LongPathfinder.cpp
Browse files Browse the repository at this point in the history
when the distance > maxDist, we should pick up a point in the waypoints .
prev = prev + (curr - prev) / 2; can cause prev bacome unwalkable.
[two walkable point's mid point maybe unwalkable]
  • Loading branch information
godlikeldh authored Apr 17, 2018
1 parent 8a9c7dc commit f912848
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/simulation2/helpers/LongPathfinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ void LongPathfinder::ImprovePathWaypoints(WaypointPath& path, pass_class_t passC
{
// We are too far away from the previous waypoint, so create one in
// between and continue with the improvement of the path
prev = prev + (curr - prev) / 2;
prev = CFixedVector2D(waypoints[k - 1].x, waypoints[k - 1].z);
newWaypoints.emplace_back(Waypoint{ prev.X, prev.Y });
}

Expand Down

0 comments on commit f912848

Please sign in to comment.