mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
Ref T229, fixed problems in FSX driver
* use correct status (the problem was that even not interpolated situations can be valid) * track last position (SimObject), do not resend same position
This commit is contained in:
@@ -1108,12 +1108,14 @@ namespace BlackSimPlugin
|
|||||||
hints.setLoggingInterpolation(logInterpolationAndParts);
|
hints.setLoggingInterpolation(logInterpolationAndParts);
|
||||||
const CAircraftSituation interpolatedSituation = simObject.getInterpolatedSituation(currentTimestamp, setup, hints, interpolatorStatus);
|
const CAircraftSituation interpolatedSituation = simObject.getInterpolatedSituation(currentTimestamp, setup, hints, interpolatorStatus);
|
||||||
|
|
||||||
if (interpolatorStatus.validAndChangedInterpolatedSituation())
|
if (interpolatorStatus.hasValidSituation())
|
||||||
{
|
{
|
||||||
// update situation
|
// update situation
|
||||||
SIMCONNECT_DATA_INITPOSITION position = this->aircraftSituationToFsxPosition(interpolatedSituation);
|
SIMCONNECT_DATA_INITPOSITION position = this->aircraftSituationToFsxPosition(interpolatedSituation);
|
||||||
HRESULT hr = S_OK;
|
if (!simObject.isSameAsSent(position))
|
||||||
hr += SimConnect_SetDataOnSimObject(m_hSimConnect, CSimConnectDefinitions::DataRemoteAircraftSetPosition,
|
{
|
||||||
|
m_simConnectObjects[simObject.getCallsign()].setPositionAsSent(position);
|
||||||
|
const HRESULT hr = SimConnect_SetDataOnSimObject(m_hSimConnect, CSimConnectDefinitions::DataRemoteAircraftSetPosition,
|
||||||
static_cast<SIMCONNECT_OBJECT_ID>(simObject.getObjectId()), 0, 0,
|
static_cast<SIMCONNECT_OBJECT_ID>(simObject.getObjectId()), 0, 0,
|
||||||
sizeof(SIMCONNECT_DATA_INITPOSITION), &position);
|
sizeof(SIMCONNECT_DATA_INITPOSITION), &position);
|
||||||
if (hr == S_OK)
|
if (hr == S_OK)
|
||||||
@@ -1125,15 +1127,13 @@ namespace BlackSimPlugin
|
|||||||
CLogMessage(this).warning("Failed so set position on SimObject '%1' callsign: '%2'") << simObject.getObjectId() << callsign;
|
CLogMessage(this).warning("Failed so set position on SimObject '%1' callsign: '%2'") << simObject.getObjectId() << callsign;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!interpolatorStatus.validInterpolatedSituation())
|
CLogMessage(this).warning("Invalid situation for SimObject '%1' callsign: '%2' info: '%3'")
|
||||||
{
|
|
||||||
CLogMessage(this).warning("Invalid interpolation for SimObject '%1' callsign: '%2' info: '%3'")
|
|
||||||
<< simObject.getObjectId() << callsign
|
<< simObject.getObjectId() << callsign
|
||||||
<< interpolatorStatus.toQString();
|
<< interpolatorStatus.toQString();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (useAircraftParts)
|
if (useAircraftParts)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user