mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-10 05:55:33 +08:00
Ref T180, directly add parts/situation in CSimConnectObject ctor
This commit is contained in:
@@ -27,6 +27,10 @@ namespace BlackSimPlugin
|
|||||||
m_interpolator(QSharedPointer<CInterpolatorMulti>::create(aircraft.getCallsign()))
|
m_interpolator(QSharedPointer<CInterpolatorMulti>::create(aircraft.getCallsign()))
|
||||||
{
|
{
|
||||||
m_interpolator->attachLogger(logger);
|
m_interpolator->attachLogger(logger);
|
||||||
|
|
||||||
|
// if available set situation and parts
|
||||||
|
if (aircraft.isPartsSynchronized()) { this->addAircraftParts(aircraft.getParts()); }
|
||||||
|
if (aircraft.getSituation().hasValidTimestamp()) { this->addAircraftSituation(aircraft.getSituation()); }
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimConnectObject::addAircraftParts(const CAircraftParts &parts)
|
void CSimConnectObject::addAircraftParts(const CAircraftParts &parts)
|
||||||
|
|||||||
@@ -858,8 +858,7 @@ namespace BlackSimPlugin
|
|||||||
// we will request a new aircraft by request ID, later we will receive its object id
|
// we will request a new aircraft by request ID, later we will receive its object id
|
||||||
// so far this object id is -1
|
// so far this object id is -1
|
||||||
addedAircraft.setRendered(false);
|
addedAircraft.setRendered(false);
|
||||||
CSimConnectObject simObject(addedAircraft, requestId, &m_interpolationLogger);
|
const CSimConnectObject simObject(addedAircraft, requestId, &m_interpolationLogger);
|
||||||
if (addedAircraft.isPartsSynchronized()) { simObject.addAircraftParts(addedAircraft.getParts()); }
|
|
||||||
m_simConnectObjects.insert(callsign, simObject);
|
m_simConnectObjects.insert(callsign, simObject);
|
||||||
adding = true;
|
adding = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user