diff --git a/src/xswiftbus/libxplanemp b/src/xswiftbus/libxplanemp index 982162942..860edd58f 160000 --- a/src/xswiftbus/libxplanemp +++ b/src/xswiftbus/libxplanemp @@ -1 +1 @@ -Subproject commit 982162942ae672bff8364c145d059aae8f015f7e +Subproject commit 860edd58f0a8f2ae51506be92321b7998ba272b3 diff --git a/src/xswiftbus/traffic.cpp b/src/xswiftbus/traffic.cpp index 6f5a095a2..3b8431237 100644 --- a/src/xswiftbus/traffic.cpp +++ b/src/xswiftbus/traffic.cpp @@ -258,17 +258,20 @@ namespace XSwiftBus id = XPMPCreatePlaneWithModelName(modelName.c_str(), aircraftIcao.c_str(), airlineIcao.c_str(), livery.c_str(), getPlaneData, planeLoaded, static_cast(this)); } - if (id) + if (!id) { - Plane *plane = new Plane(id, callsign, aircraftIcao, airlineIcao, livery, modelName); - m_planesByCallsign[callsign] = plane; - m_planesById[id] = plane; - - // Create view menu item - CMenuItem planeViewMenuItem = m_followPlaneViewSubMenu.item(callsign, [this, callsign] { enableFollowPlaneView(callsign); }); - m_followPlaneViewMenuItems[callsign] = planeViewMenuItem; - m_followPlaneViewSequence.push_back(callsign); + emitPlaneAddingFailed(callsign); + return; } + + Plane *plane = new Plane(id, callsign, aircraftIcao, airlineIcao, livery, modelName); + m_planesByCallsign[callsign] = plane; + m_planesById[id] = plane; + + // Create view menu item + CMenuItem planeViewMenuItem = m_followPlaneViewSubMenu.item(callsign, [this, callsign] { enableFollowPlaneView(callsign); }); + m_followPlaneViewMenuItems[callsign] = planeViewMenuItem; + m_followPlaneViewSequence.push_back(callsign); } void CTraffic::removePlane(const std::string &callsign)