1
0
Fork 0

Maik JUSTUS: fix bug that caused aircraft zombies on an MP player's last

position after he reset his fgfs
This commit is contained in:
mfranz 2007-01-28 11:40:56 +00:00
parent c32ffcd3c9
commit 98aa76ad33

View file

@ -469,9 +469,18 @@ FGAIMultiplayer::addMotionInfo(const FGExternalMotionData& motionInfo,
long stamp) long stamp)
{ {
mLastTimestamp = stamp; mLastTimestamp = stamp;
// Drop packets arriving out of order
if (!mMotionInfo.empty() && motionInfo.time < mMotionInfo.rbegin()->first) if (!mMotionInfo.empty()) {
return; 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;
}
mMotionInfo[motionInfo.time] = motionInfo; mMotionInfo[motionInfo.time] = motionInfo;
} }