mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
refs #324 Enable the assert in addAircraftSituation
This commit is contained in:
@@ -136,14 +136,7 @@ namespace BlackSimPlugin
|
||||
|
||||
void CSimulatorFs9::addAircraftSituation(const CCallsign &callsign, const CAircraftSituation &situation)
|
||||
{
|
||||
// FIXME: should be a Q_ASSERT
|
||||
if (!m_hashFs9Clients.contains(callsign))
|
||||
{
|
||||
// Only add a maximum number of 20 clients.
|
||||
// FIXME: We need a smart method to get the 20 nearest aircrafts. If someone logs in
|
||||
// nearby we need to kick out the one with max distance.
|
||||
return;
|
||||
}
|
||||
Q_ASSERT(m_hashFs9Clients.contains(callsign));
|
||||
|
||||
CFs9Client *client = m_hashFs9Clients.value(callsign);
|
||||
if (!client)
|
||||
|
||||
@@ -173,11 +173,8 @@ namespace BlackSimPlugin
|
||||
|
||||
void CSimulatorFsx::addAircraftSituation(const CCallsign &callsign, const CAircraftSituation &initialSituation)
|
||||
{
|
||||
if (!m_simConnectObjects.contains(callsign)) {
|
||||
// according to #324 this should not happen
|
||||
Q_ASSERT(false);
|
||||
this->addRemoteAircraft(callsign, initialSituation);
|
||||
}
|
||||
Q_ASSERT(m_simConnectObjects.contains(callsign));
|
||||
|
||||
CSimConnectObject simObj = m_simConnectObjects.value(callsign);
|
||||
simObj.getInterpolator()->addAircraftSituation(initialSituation);
|
||||
m_simConnectObjects.insert(callsign, simObj);
|
||||
|
||||
Reference in New Issue
Block a user