From: curt Date: Thu, 11 Sep 2003 19:36:04 +0000 (+0000) Subject: Changes to facilitate replaying the last "n" seconds. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5705ad715b1ae774942b1b1ce49f99e06a7fb510;p=flightgear.git Changes to facilitate replaying the last "n" seconds. --- diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index 7bab5f6c8..0efd3c09d 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -836,7 +836,12 @@ do_replay (const SGPropertyNode * arg) fgSetDouble( "/sim/replay/start-time", r->get_start_time() ); fgSetDouble( "/sim/replay/end-time", r->get_end_time() ); - fgSetDouble( "/sim/replay/time", r->get_start_time() ); + double duration = fgGetDouble( "/sim/replay/duration" ); + if( duration && duration < (r->get_end_time() - r->get_start_time()) ) { + fgSetDouble( "/sim/replay/time", r->get_end_time() - duration ); + } else { + fgSetDouble( "/sim/replay/time", r->get_start_time() ); + } cout << "start = " << r->get_start_time() << " end = " << r->get_end_time() << endl;