]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/marker_beacon.cxx
small cleanup to vivian's patch
[flightgear.git] / src / Instrumentation / marker_beacon.cxx
index 2037211bbf8e69a24d742ec3e99a9b9e4430d430..e1ca85e1208946a4fd32f8639c78df1f89ee8fd6 100644 (file)
@@ -109,11 +109,11 @@ FGMarkerBeacon::init ()
     audio_vol = node->getChild("volume", 0, true);
     serviceable = node->getChild("serviceable", 0, true);
 
-    if (power_btn->getType() == SGPropertyNode::NONE)
+    if (power_btn->getType() == simgear::props::NONE)
         power_btn->setBoolValue( true );
-    if (audio_btn->getType() == SGPropertyNode::NONE)
+    if (audio_btn->getType() == simgear::props::NONE)
         audio_btn->setBoolValue( true );
-    if (serviceable->getType() == SGPropertyNode::NONE)
+    if (serviceable->getType() == simgear::props::NONE)
         serviceable->setBoolValue( true );
 
     morse.init();
@@ -175,15 +175,14 @@ FGMarkerBeacon::update(double dt)
 
         // marker beacon blinking
         bool light_on = ( outer_blink || middle_blink || inner_blink );
-        SGTimeStamp current;
-        current.stamp();
+        SGTimeStamp current = SGTimeStamp::now();
 
-        if ( light_on && (current - blink > 400000) ) {
+        if ( light_on && blink + SGTimeStamp::fromUSec(400000) < current ) {
             light_on = false;
-            blink.stamp();
-        } else if ( !light_on && (current - blink > 100000) ) {
+            blink = current;
+        } else if ( !light_on && blink + SGTimeStamp::fromUSec(100000) < current ) {
             light_on = true;
-            blink.stamp();
+            blink = current;
         }
 
         if ( outer_marker ) {