]> git.mxchange.org Git - flightgear.git/commitdiff
#669: reset fly-by-view when a new replay loop begins
authorThorstenB <brehmt@gmail.com>
Sun, 19 Feb 2012 13:34:43 +0000 (14:34 +0100)
committerThorstenB <brehmt@gmail.com>
Sun, 19 Feb 2012 13:53:04 +0000 (14:53 +0100)
src/Aircraft/replay.cxx

index 702a8f9137ef4935cc0a8799e0bf048670a5456d..f44d38b88234f743dcf5c45040d7b0fd7c74e22e 100644 (file)
@@ -302,7 +302,8 @@ FGReplay::update( double dt )
         {
             // replay active
             double current_time = replay_time->getDoubleValue();
-            if (current_time<=0.0)
+            bool ResetTime = (current_time<=0.0);
+            if (ResetTime)
             {
                 // initialize start time
                 double startTime = get_start_time();
@@ -325,6 +326,11 @@ FGReplay::update( double dt )
             char StrBuffer[30];
             printTimeStr(StrBuffer,current_time);
             replay_time_str->setStringValue((const char*)StrBuffer);
+
+            // when time skipped (looped replay), trigger listeners to reset views etc
+            if (ResetTime)
+                replay_master->setIntValue(replay_state);
+
             return; // don't record the replay session 
         }
         case 2: // normal replay operation