Skip to content

Commit

Permalink
Merge branch 'feature/ATC-134' of https://github.com/n8rzz/atc into f…
Browse files Browse the repository at this point in the history
…eature/ATC-134
  • Loading branch information
n8rzz committed Dec 19, 2016
2 parents dad8644 + d8b7239 commit 13a69c8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/assets/scripts/aircraft/AircraftInstanceModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -1731,11 +1731,10 @@ export default class Aircraft {
*/
isOnGround() {
const error_allowance_ft = 5;
const apt = window.airportController.airport_get();
const rwy_elev = apt.getRunway(this.rwy_dep || this.rwy_arr).elevation;
const apt_elev = apt.position.elevation;
const nearRunwayAltitude = abs(this.altitude - rwy_elev) < error_allowance_ft;
const nearAirportAltitude = abs(this.altitude - apt_elev) < error_allowance_ft;
const airport = window.airportController.airport_get();
const runway = airport.getRunway(this.rwy_dep || this.rwy_arr);
const nearRunwayAltitude = abs(this.altitude - runway.elevation) < error_allowance_ft;
const nearAirportAltitude = abs(this.altitude - airport.position.elevation) < error_allowance_ft;

return nearRunwayAltitude || nearAirportAltitude;
}
Expand Down

0 comments on commit 13a69c8

Please sign in to comment.