diff --git a/src/AIModel/AITanker.cxx b/src/AIModel/AITanker.cxx index 73ec62538..6ccecc12b 100644 --- a/src/AIModel/AITanker.cxx +++ b/src/AIModel/AITanker.cxx @@ -19,10 +19,6 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -#ifdef HAVE_CONFIG_H -# include -#endif - #include "AITanker.hxx" using std::string; @@ -30,8 +26,6 @@ using std::string; FGAITanker::FGAITanker(FGAISchedule* ref): FGAIAircraft(ref){ } -FGAITanker::~FGAITanker() {} - void FGAITanker::readFromScenario(SGPropertyNode* scFileNode) { if (!scFileNode) return; @@ -39,7 +33,6 @@ void FGAITanker::readFromScenario(SGPropertyNode* scFileNode) { FGAIAircraft::readFromScenario(scFileNode); setTACANChannelID(scFileNode->getStringValue("TACAN-channel-ID","")); setName(scFileNode->getStringValue("name", "Tanker")); - } void FGAITanker::bind() { @@ -58,9 +51,7 @@ void FGAITanker::setTACANChannelID(const string& id) { } void FGAITanker::Run(double dt) { - //FGAIAircraft::Run(dt); - - double start = pos.getElevationFt() + 1000; + double start = pos.getElevationFt() + 1000.0; altitude_agl_ft = _getAltitudeAGL(pos, start); //###########################// @@ -69,17 +60,13 @@ void FGAITanker::Run(double dt) { double range_ft2 = UpdateRadar(manager); // check if radar contact - if ( (range_ft2 < 250.0 * 250.0) && (y_shift > 0.0) - && (elevation > 0.0) ) { - //refuel_node->setBoolValue(true); + if ( (range_ft2 < 250.0 * 250.0) && (y_shift > 0.0) && (elevation > 0.0) ) { contact = true; } else { - //refuel_node->setBoolValue(false); contact = false; } } - void FGAITanker::update(double dt) { FGAIAircraft::update(dt); Run(dt); diff --git a/src/AIModel/AITanker.hxx b/src/AIModel/AITanker.hxx index 2dd031f3c..6d267ba3b 100644 --- a/src/AIModel/AITanker.hxx +++ b/src/AIModel/AITanker.hxx @@ -19,8 +19,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -#ifndef FGAITANKER_HXX -#define FGAITANKER_HXX +#pragma once #include "AIAircraft.hxx" @@ -37,21 +36,18 @@ class FGAITanker : public FGAIAircraft { public: FGAITanker(FGAISchedule* ref = 0); - ~FGAITanker(); - - void readFromScenario(SGPropertyNode* scFileNode) override; - void bind() override; + virtual ~FGAITanker() = default; const char* getTypeString(void) const override { return "tanker"; } + void readFromScenario(SGPropertyNode* scFileNode) override; + void bind() override; void setTACANChannelID(const std::string& id); private: std::string TACAN_channel_id; // The TACAN channel of this tanker - bool contact; // set if this tanker is within fuelling range + bool contact = false; // set if this tanker is within fuelling range virtual void Run(double dt); void update(double dt) override; }; - -#endif