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:
parent
c32ffcd3c9
commit
98aa76ad33
1 changed files with 12 additions and 3 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue