From 52410b5117b8ba2d826d97ec2d6005d346045016 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Wed, 24 Apr 2024 22:50:14 +0200 Subject: [PATCH] fix: Don't use controller info from datafile on non-VATSIM servers Fixes #280 --- src/blackcore/airspacemonitor.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/blackcore/airspacemonitor.cpp b/src/blackcore/airspacemonitor.cpp index 8ca17067d..531dd4875 100644 --- a/src/blackcore/airspacemonitor.cpp +++ b/src/blackcore/airspacemonitor.cpp @@ -672,8 +672,14 @@ namespace BlackCore const CAtcStationList stationsWithCallsign = m_atcStationsOnline.findByCallsign(callsign); if (stationsWithCallsign.isEmpty()) { - // new station, init with data from data file - CAtcStation station(sApp->getWebDataServices()->getAtcStationsForCallsign(callsign).frontOrDefault()); + CAtcStation station; + + // if connected to VATSIM, init with data from data file + if (this->getConnectedServer().getEcosystem() == CEcosystem::vatsim()) + { + station = sApp->getWebDataServices()->getAtcStationsForCallsign(callsign).frontOrDefault(); + } + station.setCallsign(callsign); station.setRange(range); station.setFrequency(frequency);