refs #570 Each CAircraftSituation can have its own time offset, instead of a hardcoded 6 seconds.

This commit is contained in:
Mathew Sutcliffe
2016-06-02 01:24:05 +01:00
parent cf9944f1c7
commit eecc4d75e9
3 changed files with 32 additions and 5 deletions

View File

@@ -1113,6 +1113,12 @@ namespace BlackCore
// check sort order
Q_ASSERT_X(l.size() < 2 || l[0].getMSecsSinceEpoch() >= l[1].getMSecsSinceEpoch(), Q_FUNC_INFO, "wrong sort order");
// a full position update received after an interim position update should use the time offset of the interim position
if (l.size() >= 2 && (l[0].isInterim() || l[1].isInterim()))
{
l[0].setTimeOffsetMs(std::min(l[0].getTimeOffsetMs(), l[1].getTimeOffsetMs()));
}
}
void CAirspaceMonitor::storeAircraftParts(const CCallsign &callsign, const CAircraftParts &parts)