]> git.mxchange.org Git - flightgear.git/commitdiff
Fix warning 'AI Aircraft without FlightPlan'
authorJames Turner <zakalawe@mac.com>
Sat, 26 Oct 2013 17:45:27 +0000 (18:45 +0100)
committerJames Turner <zakalawe@mac.com>
Sat, 26 Oct 2013 17:45:27 +0000 (18:45 +0100)
Remove the false warning when using AI Aircraft without a flightplan.
This is (it turns out) a supported use case.

src/AIModel/AIAircraft.cxx

index eac696d1030e4ccb98f15bf0110025058ff29816..509fa5f6ace4d4d9b2fd6ebe1976cc6207912eec 100644 (file)
@@ -238,7 +238,8 @@ double FGAIAircraft::sign(double x) {
 void FGAIAircraft::setFlightPlan(const std::string& flightplan, bool repeat)
 {
     if (flightplan.empty()) {
-        SG_LOG(SG_AI, SG_WARN, "setFlightPlan: empty flight plan");
+        // this is the case for Nasal-scripted aircraft
+        return;
     }
     
     FGAIFlightPlan* fp = new FGAIFlightPlan(flightplan);
@@ -252,7 +253,8 @@ void FGAIAircraft::setFlightPlan(const std::string& flightplan, bool repeat)
 }
 
 
-void FGAIAircraft::SetFlightPlan(FGAIFlightPlan *f) {
+void FGAIAircraft::SetFlightPlan(FGAIFlightPlan *f)
+{
     delete fp;
     fp = f;
 }