]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/gps.cxx
small cleanup to vivian's patch
[flightgear.git] / src / Instrumentation / gps.cxx
index 981c35af2e9978ab74eeb6f8c0b5ac7204745e28..2d448f575a94e833c409ce80247ef0c409c470bd 100644 (file)
@@ -479,9 +479,8 @@ GPS::updateTTWNode(UpdateContext& ctx, double distance_m, SGPropertyNode_ptr nod
     if (ctx.speed_kt > 0.0 && distance_m > 0.0) {
         TTW = (distance_m * SG_METER_TO_NM) / (ctx.speed_kt / 3600);
     }
-   
-    unsigned int TTW_seconds = (int) (TTW + 0.5);
-    if (TTW_seconds < 356400) { // That's 99 hours
+    if (TTW < 356400.5) { // That's 99 hours
+      unsigned int TTW_seconds = (int) (TTW + 0.5);
       unsigned int TTW_minutes = 0;
       unsigned int TTW_hours   = 0;
       char TTW_str[9];