From cc23e29ef02f877a07979bc108acb87e5264de84 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sat, 26 Oct 2013 18:45:27 +0100 Subject: [PATCH] Fix warning 'AI Aircraft without FlightPlan' Remove the false warning when using AI Aircraft without a flightplan. This is (it turns out) a supported use case. --- src/AIModel/AIAircraft.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/AIModel/AIAircraft.cxx b/src/AIModel/AIAircraft.cxx index eac696d10..509fa5f6a 100644 --- a/src/AIModel/AIAircraft.cxx +++ b/src/AIModel/AIAircraft.cxx @@ -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; } -- 2.39.5