mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
refs #852 Add a time offset to CAircraftParts.
This commit is contained in:
@@ -1227,11 +1227,21 @@ namespace BlackCore
|
||||
BLACK_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "empty callsign");
|
||||
if (callsign.isEmpty()) { return; }
|
||||
|
||||
// get time offset from situation
|
||||
qint64 timeOffsetMs = 6000; //! \fixme 6000 is assumed default offset, copied from CNetworkVatlib::onPilotPositionUpdate
|
||||
{
|
||||
QReadLocker lock(&m_lockSituations);
|
||||
const CAircraftSituationList &situationList = this->m_situationsByCallsign[callsign];
|
||||
if (!situationList.isEmpty()) { timeOffsetMs = situationList[0].getTimeOffsetMs(); }
|
||||
}
|
||||
|
||||
// list sorted from new to old
|
||||
QWriteLocker lock(&m_lockParts);
|
||||
CAircraftPartsList &partsList = this->m_partsByCallsign[callsign];
|
||||
partsList.push_frontMaxElements(parts, MaxPartsPerCallsign);
|
||||
|
||||
partsList.front().setTimeOffsetMs(timeOffsetMs);
|
||||
|
||||
if (!m_aircraftSupportingParts.contains(callsign))
|
||||
{
|
||||
m_aircraftSupportingParts.push_back(callsign); // mark as callsign which supports parts
|
||||
|
||||
Reference in New Issue
Block a user