Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix/ATC-115 #117

Merged
merged 1 commit into from
Nov 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/assets/scripts/airport/AirportController.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ export default class AirportController {
this.aircraftController.aircraft_remove_all();
}

const newAirport = this.airport.airports[icao];
newAirport.set();
const nextAirportModel = this.airport.airports[icao];
nextAirportModel.set();
}
/**
* @function airport_get
Expand Down
11 changes: 10 additions & 1 deletion src/assets/scripts/airport/AirportModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ export default class AirportModel {
this.rr_radius_nm = _get(data, 'rr_radius_nm');
this.rr_center = _get(data, 'rr_center');

FixCollection.init(data.fixes, this.position);
this.fixes = _get(data, 'fixes', {});
FixCollection.init(this.fixes, this.position);

this.sidCollection = new StandardRouteCollection(data.sids);
this.starCollection = new StandardRouteCollection(data.stars);

Expand Down Expand Up @@ -411,7 +413,14 @@ export default class AirportModel {
$(SELECTORS.DOM_SELECTORS.TOGGLE_TERRAIN).toggle(!_isEmpty(this.terrain));

window.gameController.game_reset_score();

this.start = window.gameController.game_time();

// when the parse method is run, this method also runs. however, when an airport is being re-loaded,
// only this method runs. this doesnt belong here but needs to be here so the fixes get populated correctly.
// FIXME: make FixCollection a instance class ainstead of a static class
FixCollection.init(this.fixes, this.position);

this.updateRunway();
this.addAircraft();
this.updateRun(true);
Expand Down