From: James Turner Date: Sat, 26 Oct 2013 17:45:27 +0000 (+0100) Subject: Fix warning 'AI Aircraft without FlightPlan' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cc23e29ef02f877a07979bc108acb87e5264de84;p=flightgear.git 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. --- 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; }