Skip to content

Commit 4383c5c

Browse files
committed
Fixed the weird exit-point bugginess, where the aircraft would head to
the wrong exit point in exceptional cases.
1 parent c06f738 commit 4383c5c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ini-atc/src/seprini/controllers/components/FlightPlanComponent.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,16 @@ private ArrayList<Waypoint> flightPlanWaypointGenerator(
6464
// Create the list of waypoints for the generator to choose from,
6565
// including the final waypoint so that the base case can be
6666
// satisfied;
67-
ArrayList<Waypoint> waypointSelectionList = waypoints.getPermanentList();
67+
ArrayList<Waypoint> waypointSelectionList = new ArrayList<Waypoint>(waypoints.getPermanentList());
6868
waypointSelectionList.add(lastWaypoint);
6969

7070
// Call selectNextWaypoint.
7171
Waypoint nextWaypoint = selectNextWaypoint(currentWaypoint,
7272
lastWaypoint, flightPlan, normalVectorFromCurrentToLast,
73-
waypointSelectionList, 30, 100);
73+
waypointSelectionList, 30, 150);
74+
75+
waypointSelectionList.clear();
76+
7477
// Recurse with updated flightPlan and nextWaypoint.
7578
return flightPlanWaypointGenerator(flightPlan, nextWaypoint,
7679
lastWaypoint);
@@ -146,7 +149,7 @@ private Waypoint setStartpoint() {
146149
* @param entryWaypoint
147150
* - where this aircraft entered the game
148151
* @param minDistance
149-
* - desired minimum distance between aircrafts entryWaypoint and
152+
* - desired minimum distance between aircraft's entryWaypoint and
150153
* its exitWaypoint.
151154
* @return Exitpoint
152155
*/

0 commit comments

Comments
 (0)