]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/MapWidget.cxx
GUI support for VIA/Discontinuity
[flightgear.git] / src / GUI / MapWidget.cxx
index b5237d8a039d0f91cbd0eb3d3c1e2275d6861708..bb44327fb30d49cdd6dd842652e0ecb1af87048a 100644 (file)
@@ -27,6 +27,7 @@
 #include <Navaids/routePath.hxx>
 #include <Aircraft/FlightHistory.hxx>
 #include <AIModel/AIAircraft.hxx>
+#include <AIModel/AIManager.hxx>
 #include <AIModel/AIFlightPlan.hxx>
 
 const char* RULER_LEGEND_KEY = "ruler-legend";
@@ -1977,7 +1978,7 @@ MapWidget::DrawAIObject::DrawAIObject(SGPropertyNode* m, const SGGeod& g) :
         // try to access the flight-plan of the aircraft. There are several layers
         // of potential NULL-ness here, so we have to be defensive at each stage.
         std::string originICAO, destinationICAO;
-        FGAIManager* aiManager = static_cast<FGAIManager*>(globals->get_subsystem("ai-model"));
+        FGAIManager* aiManager = globals->get_subsystem<FGAIManager>();
         FGAIBasePtr aircraft = aiManager ? aiManager->getObjectFromProperty(model) : NULL;
         if (aircraft) {
             FGAIAircraft* p = static_cast<FGAIAircraft*>(aircraft.get());