From 88788dc6aba17a7af0269a2f5909ac156e6717dd Mon Sep 17 00:00:00 2001 From: Thomas LESNE Date: Wed, 24 Jun 2020 21:58:48 +0200 Subject: [PATCH] Fix attributes for multiplayer and AI airplanes in Phi (fix #2274) --- Phi/topics/Map/AILayer.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Phi/topics/Map/AILayer.js b/Phi/topics/Map/AILayer.js index 2f070a1c1..11c694333 100644 --- a/Phi/topics/Map/AILayer.js +++ b/Phi/topics/Map/AILayer.js @@ -163,9 +163,6 @@ var speed = 0; var departureAirportId = ""; var arrivalAirportId = ""; - if (type == "multiplayer") { - name = child.getNode("sim").getNode("model").getNode("path").getValue(); - } if (type == "carrier") { callsign = child.getNode("sign").getValue(); name = child.getNode("name").getValue(); @@ -173,8 +170,13 @@ } else { callsign = child.getNode("callsign").getValue(); speed = velocities.getNode("true-airspeed-kt").getValue(); - departureAirportId = child.getNode("departure-airport-id").getValue(); - arrivalAirportId = child.getNode("arrival-airport-id").getValue(); + + if (type == "multiplayer") { + name = child.getNode("sim").getNode("model").getNode("path").getValue(); + } else { + departureAirportId = child.getNode("departure-airport-id").getValue(); + arrivalAirportId = child.getNode("arrival-airport-id").getValue(); + } } geoJSON.features.push({