diff --git a/TODO.md b/TODO.md index b9ea2ca..389788f 100644 --- a/TODO.md +++ b/TODO.md @@ -148,4 +148,4 @@ Sector -> Volumes(VolumeName) Volumes.xml Meta -> Line Volume(Name) -> Boundaries(Name) -Volume(ARA) -> Boundaries(ARAFURA) \ No newline at end of file +Volume(ARA) -> Boundaries(ARAFURA) diff --git a/atc.js b/atc.js index a05cf4a..93c36d9 100644 --- a/atc.js +++ b/atc.js @@ -247,7 +247,7 @@ export async function getOnlineControllers(){ return; } // Check if they are controller for the right region. - if (!sectors.some(sector => sector.Callsign == controller.callsign.toUpperCase())) + if (!sectors.some(sector => sector.Callsign == controller.callsign.toUpperCase())) { return; } @@ -298,9 +298,9 @@ export async function getOnlinePositions() { if (activeFrequencies.length <= 1) return; // activeFrequencies.forEach(function(activeFrequency) { - // Get all the sectors that use that frequency (but only CTR). + // Get all the sectors that use that frequency (but only the same position type as the primary position). var frequencySectors = sectors.filter(sector => sector.Frequency == activeFrequency - && sector.Callsign.toUpperCase().includes("CTR")); + && sector.volumes.length > 0 && sector.Callsign.toUpperCase().endsWith(onlineController.callsign.toUpperCase().slice(-3))); // If nothing found, continue. if (!frequencySectors) return; var extendedSector; @@ -350,4 +350,4 @@ function getDistanceInKm(sector1, sector2) { function deg2rad(deg) { return deg * (Math.PI/180) -} \ No newline at end of file +}