Simbrief parser: handle no alternate
This commit is contained in:
parent
573dbac463
commit
171a9296e1
1 changed files with 8 additions and 6 deletions
|
@ -134,12 +134,14 @@ var SimbriefParser = {
|
||||||
fmgc.flightPlanController.flightplans[3].destination_runway = runwayStore;
|
fmgc.flightPlanController.flightplans[3].destination_runway = runwayStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
var alternateID = me.OFP.getNode("alternate/icao_code").getValue();
|
var alternateID = me.OFP.getNode("alternate/icao_code") == nil ? nil : me.OFP.getNode("alternate/icao_code").getValue();
|
||||||
var alternates = findAirportsByICAO(alternateID);
|
if (alternateID != nil) {
|
||||||
if (alternates != nil and size(alternates) != 0) {
|
var alternates = findAirportsByICAO(alternateID);
|
||||||
fmgc.FMGCInternal.altAirport = alternateID;
|
if (size(alternates) != 0) {
|
||||||
atsu.ATISInstances[2].newStation(alternateID);
|
fmgc.FMGCInternal.altAirport = alternateID;
|
||||||
fmgc.FMGCInternal.altAirportSet = 1;
|
atsu.ATISInstances[2].newStation(alternateID);
|
||||||
|
fmgc.FMGCInternal.altAirportSet = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var wps = [];
|
var wps = [];
|
||||||
|
|
Loading…
Add table
Reference in a new issue