From d474b04aa8be5aea8cd7d8b55ff44b671b9a3840 Mon Sep 17 00:00:00 2001 From: Nate Geslin Date: Thu, 22 Dec 2016 17:35:47 -0600 Subject: [PATCH 1/2] bugfix/ATC-237 - Adds reset for current indicies within followSTAR method and a get fallback for currentWaypoint speed --- CHANGELOG.md | 4 ++++ .../scripts/client/aircraft/AircraftInstanceModel.js | 2 +- .../AircraftFlightManagementSystem.js | 9 +++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cba220f..53de1cfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) + + diff --git a/src/assets/scripts/client/aircraft/AircraftInstanceModel.js b/src/assets/scripts/client/aircraft/AircraftInstanceModel.js index e32cacf2..32d690ae 100644 --- a/src/assets/scripts/client/aircraft/AircraftInstanceModel.js +++ b/src/assets/scripts/client/aircraft/AircraftInstanceModel.js @@ -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); } diff --git a/src/assets/scripts/client/aircraft/FlightManagementSystem/AircraftFlightManagementSystem.js b/src/assets/scripts/client/aircraft/FlightManagementSystem/AircraftFlightManagementSystem.js index 1fa72fa7..45c403e9 100644 --- a/src/assets/scripts/client/aircraft/FlightManagementSystem/AircraftFlightManagementSystem.js +++ b/src/assets/scripts/client/aircraft/FlightManagementSystem/AircraftFlightManagementSystem.js @@ -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` @@ -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) { From b851c5184f8a60dbd9a59e99506d59954a9aa160 Mon Sep 17 00:00:00 2001 From: Nate Geslin Date: Thu, 22 Dec 2016 18:42:58 -0600 Subject: [PATCH 2/2] bugfix/ATC-237 - adds additional affected issues to changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53de1cfa..a63f77c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,8 +24,8 @@ ### 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) +- Resets current indicies when issuing a new star to an arriving aircraft [#104](https://github.com/n8rzz/atc/issues/104) & [#237](https://github.com/n8rzz/atc/issues/237) + - Originally reported under [zlsa#730](https://github.com/zlsa/atc/issues/730) & [zlsa#768](https://github.com/zlsa/atc/issues/768)