From ed8970a29dd3df90b48c6e279b122cf1fafc3f30 Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 5 Jan 2016 23:16:34 -0600 Subject: [PATCH] Fix some more uses of libC time() --- src/Autopilot/route_mgr.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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); } } -- 2.39.5