mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
Avoid empty callsign objects
This commit is contained in:
@@ -202,12 +202,14 @@ namespace BlackCore
|
|||||||
CUserList users;
|
CUserList users;
|
||||||
for (const CAtcStation &station : m_atcStationsOnline)
|
for (const CAtcStation &station : m_atcStationsOnline)
|
||||||
{
|
{
|
||||||
const CUser user = station.getController();
|
CUser user = station.getController();
|
||||||
|
if (!user.hasCallsign()) { user.setCallsign(station.getCallsign()); }
|
||||||
users.push_back(user);
|
users.push_back(user);
|
||||||
}
|
}
|
||||||
for (const CSimulatedAircraft &aircraft : this->getAircraftInRange())
|
for (const CSimulatedAircraft &aircraft : this->getAircraftInRange())
|
||||||
{
|
{
|
||||||
const CUser user = aircraft.getPilot();
|
CUser user = aircraft.getPilot();
|
||||||
|
if (!user.hasCallsign()) { user.setCallsign(aircraft.getCallsign()); }
|
||||||
users.push_back(user);
|
users.push_back(user);
|
||||||
}
|
}
|
||||||
return users;
|
return users;
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ namespace BlackMisc
|
|||||||
QHash<CCallsign, OBJ> hash;
|
QHash<CCallsign, OBJ> hash;
|
||||||
for (const OBJ &obj : this->container())
|
for (const OBJ &obj : this->container())
|
||||||
{
|
{
|
||||||
|
if (obj.getCallsign().isEmpty()) { continue; }
|
||||||
hash.insert(obj.getCallsign(), obj);
|
hash.insert(obj.getCallsign(), obj);
|
||||||
}
|
}
|
||||||
return hash;
|
return hash;
|
||||||
|
|||||||
Reference in New Issue
Block a user