From 3a901863412ce96836cd4325c822b860bc257d8f Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Thu, 24 Mar 2011 23:30:09 +0100 Subject: [PATCH] Minor replay issues When disabling replay: don't clear buffers and restore most recent frame --- src/Aircraft/replay.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Aircraft/replay.cxx b/src/Aircraft/replay.cxx index 538546c81..bd3bab7bf 100644 --- a/src/Aircraft/replay.cxx +++ b/src/Aircraft/replay.cxx @@ -24,6 +24,7 @@ # include "config.h" #endif +#include #include #include @@ -156,11 +157,16 @@ void FGReplay::update( double dt ) timingInfo.clear(); stamp("begin"); - if (( sim_time != 0.0 )&& - ( disable_replay->getBoolValue() )) + if ( disable_replay->getBoolValue() ) { - // we were recording data - reinit(); + if (replay_master->getIntValue()) + { + // replay was active, restore most recent frame + replay(DBL_MAX); + } + replay_master->setIntValue(0); + replay_time->setDoubleValue(0); + disable_replay->setBoolValue(0); } int replay_state = replay_master->getIntValue();