From: James Turner Date: Wed, 6 Jan 2016 05:16:34 +0000 (-0600) Subject: Fix some more uses of libC time() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ed8970a29dd3df90b48c6e279b122cf1fafc3f30;p=flightgear.git Fix some more uses of libC time() --- diff --git a/src/Autopilot/route_mgr.cxx b/src/Autopilot/route_mgr.cxx index 0ef6e72c2..f58c57ac4 100644 --- a/src/Autopilot/route_mgr.cxx +++ b/src/Autopilot/route_mgr.cxx @@ -27,10 +27,6 @@ # include #endif -#ifdef HAVE_WINDOWS_H -#include -#endif - #include #include @@ -45,6 +41,7 @@ #include #include #include +#include #include #include "Main/fg_props.hxx" @@ -454,12 +451,12 @@ void FGRouteMgr::update( double dt ) double gs = groundSpeed->getDoubleValue(); if (airborne->getBoolValue()) { - time_t now = time(NULL); + time_t now = globals->get_time_params()->get_cur_time(); elapsedFlightTime->setDoubleValue(difftime(now, _takeoffTime)); if (weightOnWheels->getBoolValue()) { // touch down - destination->setIntValue("touchdown-time", time(NULL)); + destination->setIntValue("touchdown-time", now); airborne->setBoolValue(false); } } else { // not airborne @@ -467,7 +464,7 @@ void FGRouteMgr::update( double dt ) // either taking-off or rolling-out after touchdown } else { airborne->setBoolValue(true); - _takeoffTime = time(NULL); // start the clock + _takeoffTime = globals->get_time_params()->get_cur_time(); // start the clock departure->setIntValue("takeoff-time", _takeoffTime); } }