mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
refs #895, reset to "invalid" sentParts when object is added
(makes sure the parts are sent at least once)
This commit is contained in:
committed by
Mathew Sutcliffe
parent
6a63bcf666
commit
8b1c8c068b
@@ -30,6 +30,13 @@ namespace BlackSimPlugin
|
||||
m_interpolator->attachLogger(logger);
|
||||
}
|
||||
|
||||
void CSimConnectObject::invalidatePartsAsSent()
|
||||
{
|
||||
DataDefinitionRemoteAircraftPartsWithoutLights dd;
|
||||
dd.resetToInvalid();
|
||||
m_partsAsSent = dd;
|
||||
}
|
||||
|
||||
bool CSimConnectObject::isPendingAdded() const
|
||||
{
|
||||
return !this->hasValidRequestAndObjectId() || !this->m_confirmedAdded;
|
||||
@@ -58,7 +65,7 @@ namespace BlackSimPlugin
|
||||
return this->hasValidRequestId() && this->hasValidObjectId();
|
||||
}
|
||||
|
||||
bool CSimConnectObjects::setSimConnectObjectIdForRequestId(DWORD requestId, DWORD objectId)
|
||||
bool CSimConnectObjects::setSimConnectObjectIdForRequestId(DWORD requestId, DWORD objectId, bool resetSentParts)
|
||||
{
|
||||
// First check, if this request id belongs to us
|
||||
auto it = std::find_if(this->begin(), this->end(), [requestId](const CSimConnectObject & obj) { return obj.getRequestId() == requestId; });
|
||||
@@ -66,6 +73,7 @@ namespace BlackSimPlugin
|
||||
|
||||
// belongs to us
|
||||
it->setObjectId(objectId);
|
||||
if (resetSentParts) { it->invalidatePartsAsSent(); }
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user