]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIShip.cxx
Interim windows build fix
[flightgear.git] / src / AIModel / AIShip.cxx
index a202feb48b677748193e236c046d050078ea7475..9ec3718bd3000ac9bee1fddb625a492d0c5afb0b 100644 (file)
 #  include <config.h>
 #endif
 
+#include <cmath>
+
 #ifdef _MSC_VER
 #  include <float.h>
-#  define finite _finite
-#elif defined(__sun) || defined(sgi)
-#  include <ieeefp.h>
+    double fgIsFinite(double x) { return _finite(x); }
+#else
+    double fgIsFinite(double x) { return std::isfinite(x); }
 #endif
 
-#include <math.h>
-
 #include <simgear/sg_inlines.h>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/timing/sg_time.hxx>
@@ -37,6 +37,7 @@
 
 #include <simgear/scene/util/SGNodeMasks.hxx>
 #include <Scenery/scenery.hxx>
+#include <Main/globals.hxx>
 
 #include "AIShip.hxx"
 
@@ -155,8 +156,6 @@ void FGAIShip::bind() {
         SGRawValuePointer<double>(&tgt_speed));
     tie("controls/tgt-heading-degs",
         SGRawValuePointer<double>(&tgt_heading));
-    tie("controls/constants/rudder",
-        SGRawValuePointer<double>(&_rudder_constant));
     tie("controls/constants/roll-factor",
         SGRawValuePointer<double>(&_roll_factor));
     tie("controls/constants/roll",
@@ -792,7 +791,7 @@ void FGAIShip::ProcessFlightPlan(double dt) {
     //   now revise the required course for the next way point
     _course = getCourse(pos.getLatitudeDeg(), pos.getLongitudeDeg(), curr->getLatitude(), curr->getLongitude());
 
-    if (finite(_course))
+    if (fgIsFinite(_course))
         TurnTo(_course);
     else
         SG_LOG(SG_AI, SG_ALERT, "AIShip: Bearing or Range is not a finite number");