Skip to content

Commit

Permalink
bugfix/ATC-237 - Adds reset for current indicies within followSTAR me…
Browse files Browse the repository at this point in the history
…thod and a get fallback for currentWaypoint speed
  • Loading branch information
n8rzz committed Dec 22, 2016
1 parent 17ecaa4 commit d474b04
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@


### Bugfixes
- Resets current indicies when issuing a new star to an arriving aircraft [#237](https://github.com/n8rzz/atc/issues/237)
- Originally reported under [zlsa#768](https://github.com/zlsa/atc/issues/768)





Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,7 @@ export default class Aircraft {
this.target.altitude = this.fms.altitudeForCurrentWaypoint();
this.target.expedite = this.fms.currentWaypoint.expedite;
this.target.altitude = Math.max(1000, this.target.altitude);
this.target.speed = this.fms.currentWaypoint.speed;
this.target.speed = _get(this, 'fms.currentWaypoint.speed', this.speed);
this.target.speed = clamp(this.model.speed.min, this.target.speed, this.model.speed.max);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,13 @@ export default class AircraftFlightManagementSystem {
}
}

// this may not be the correct spot for this
this.current = [0, 0];
// Add the new STAR Leg
this.appendLeg({ type: FP_LEG_TYPE.STAR, route: route });
this.appendLeg({
route,
type: FP_LEG_TYPE.STAR
});
}

// TODO: move this logic to the `RouteModel`
Expand Down Expand Up @@ -597,7 +602,7 @@ export default class AircraftFlightManagementSystem {
// TODO: this should be abstracted to another class method.
const pieces = data[i].split('.');
// FIXME: what does 'a' mean? better naming
a = [pieces[0] + '.' + pieces[1] + '.' + pieces[2]];
a = [`${pieces[0]}.${pieces[1]}.${pieces[2]}`];

// chop up the multilink
for (let j = 3; j < data[i].split('.').length; j + 2) {
Expand Down

0 comments on commit d474b04

Please sign in to comment.