From 930c77b69f7197a51c8c90284fcfd32932c58efd Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Sun, 27 Jun 2021 22:41:48 +0100 Subject: [PATCH] src/Aircraft/replay.cxx: fix bug with end of replay end when recording multiplayer. With Normal recordings, if we are recording multiplayer aircraft, we continue appending to the in-memory recording while replaying, so we need to stop when we reach the original end of recorded frames. --- src/Aircraft/replay.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Aircraft/replay.cxx b/src/Aircraft/replay.cxx index 6035f0c32..72078c877 100644 --- a/src/Aircraft/replay.cxx +++ b/src/Aircraft/replay.cxx @@ -1670,7 +1670,13 @@ FGReplay::replay( double time ) { } if ( ! short_term.empty() ) { - t1 = short_term.back()->sim_time; + // We use /sim/replay/end-time instead of short_term.back()->sim_time + // because if we are recording multiplayer aircraft, new items will + // be appended to short_term while we replay, and we don't want to + // continue replaying into them. /sim/replay/end-time will remain + // pointing to the last frame at the time we started replaying. + // + t1 = fgGetDouble("/sim/replay/end-time"); t2 = short_term.front()->sim_time; if ( time > t1 ) { // replay the most recent frame