mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +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->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)
|
||||
|
||||
@@ -858,8 +858,7 @@ namespace BlackSimPlugin
|
||||
// we will request a new aircraft by request ID, later we will receive its object id
|
||||
// so far this object id is -1
|
||||
addedAircraft.setRendered(false);
|
||||
CSimConnectObject simObject(addedAircraft, requestId, &m_interpolationLogger);
|
||||
if (addedAircraft.isPartsSynchronized()) { simObject.addAircraftParts(addedAircraft.getParts()); }
|
||||
const CSimConnectObject simObject(addedAircraft, requestId, &m_interpolationLogger);
|
||||
m_simConnectObjects.insert(callsign, simObject);
|
||||
adding = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user