1
0
Fork 0

Invalid flightplan input won't crash flightgear

This commit is contained in:
legoboyvdlp R 2020-08-07 11:44:03 +01:00
parent 2de52d1b11
commit e48e060ef6
2 changed files with 3 additions and 3 deletions

View file

@ -11,7 +11,7 @@ var SimbriefParser = {
me.inhibit = 1;
var stamp = systime();
http.save("https://www.simbrief.com/api/xml.fetcher.php?username=" ~ username, getprop('/sim/fg-home') ~ "/Export/A320-family-simbrief.xml")
.fail(func mcdu.mcdu_message(i, "SIMBRIEF FAILED"))
.fail(func mcdu.mcdu_message(i, "SIMBRIEF DOWNLOAD FAILED"))
.done(func me.read(getprop('/sim/fg-home') ~ "/Export/A320-family-simbrief.xml", i));
},
read: func(xml, i) {
@ -35,7 +35,7 @@ var SimbriefParser = {
me.store1 = me.OFP.getChild("general");
me.store2 = me.OFP.getChild("alternate");
fmgc.FMGCInternal.flightNum = me.store1.getChild("icao_airline").getValue() ~ me.store1.getChild("flight_number").getValue();
fmgc.FMGCInternal.flightNum = me.store1.getChild("icao_airline").getValue() or "" ~ me.store1.getChild("flight_number").getValue() or "";
fmgc.FMGCInternal.flightNumSet = 1;
fmgc.FMGCInternal.costIndex = me.store1.getChild("costindex").getValue();
fmgc.FMGCInternal.costIndexSet = 1;

View file

@ -172,7 +172,7 @@ var MessageController = {
TypeIMessage.new("TMPY F-PLN EXISTS", 1),TypeIMessage.new("SELECT DESIRED SYSTEM"),TypeIMessage.new("SELECT HDG/TRK FIRST"),
TypeIMessage.new("USING COST INDEX N", 1),TypeIMessage.new("WAIT FOR SYSTEM RESPONSE"),TypeIMessage.new("RWY/LS MISMATCH"),
TypeIMessage.new("VHF3 VOICE MSG NOT GEN"),TypeIMessage.new("NO COMM MSG NOT GEN"),TypeIMessage.new("WX UPLINK"),
TypeIMessage.new("SIMBRIEF FAILED"),TypeIMessage.new("MISSING USERNAME"),TypeIMessage.new("AOC ACT F-PLN UPLINK"),
TypeIMessage.new("SIMBRIEF DOWNLOAD FAILED"),TypeIMessage.new("MISSING USERNAME"),TypeIMessage.new("AOC ACT F-PLN UPLINK"),
]),
typeIIMessages: std.Vector.new([
TypeIIMessage.new("LAT DISCONT AHEAD", "amb", 0),TypeIIMessage.new("MORE DRAG"),TypeIIMessage.new("RWY/LS MISMATCH", "amb", 0),TypeIIMessage.new("STEP DELETED"),