From 411953e89b809f152f58cfad5cfcf93135943572 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Thu, 10 Jun 2021 07:09:03 +0100 Subject: [PATCH] src/AIModel/AIMultiplayer.cxx: fixed some replay unevenness. We previously ignored mp packets if their .time was very different from local time, but this stops time-compensation (e.g. with simple-time) from working and is unnecessary because we clean up old packets anyway. Also removed unnecessary erase of mp packets after interpolation. --- src/AIModel/AIMultiplayer.cxx | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/AIModel/AIMultiplayer.cxx b/src/AIModel/AIMultiplayer.cxx index c3850da35..be5311874 100644 --- a/src/AIModel/AIMultiplayer.cxx +++ b/src/AIModel/AIMultiplayer.cxx @@ -238,13 +238,6 @@ void FGAIMultiplayer::FGAIMultiplayerInterpolate( ++nextPropIt; } } - - // Now throw away too old data - if (prevIt != mMotionInfo.begin()) - { - --prevIt; - mMotionInfo.erase(mMotionInfo.begin(), prevIt); - } } void FGAIMultiplayer::FGAIMultiplayerExtrapolate( @@ -645,6 +638,7 @@ void FGAIMultiplayer::update(double dt) else if (nextIt == mMotionInfo.begin()) { // Leave prevIt and nextIt pointing at same item. + SG_LOG(SG_GENERAL, SG_DEBUG, "Only one frame for interpolation: " << _callsign); } else { @@ -758,18 +752,6 @@ FGAIMultiplayer::addMotionInfo(FGExternalMotionData& motionInfo, { mLastTimestamp = stamp; - if (!mMotionInfo.empty()) { - double diff = motionInfo.time - mMotionInfo.rbegin()->first; - - // packet is very old -- MP has probably reset (incl. his timebase) - if (diff < -10.0) - mMotionInfo.clear(); - - // drop packets arriving out of order - else if (diff < 0.0) - return; - } - if (m_simple_time_enabled->getBoolValue()) { // Update simple-time stats and set m_simple_time_compensation. //