Skip to content

Commit

Permalink
Enforce extending to the same position type only
Browse files Browse the repository at this point in the history
  • Loading branch information
azfv authored Apr 20, 2024
1 parent fc83f42 commit 98370f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions atc.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,12 @@ export async function getOnlinePositions() {
activeFrequencies.push(convertedFrequency);
});
// if only 1 frequency, nothing else to do.
if (activeFrequencies.length <= 1 || !sector.Callsign.toUpperCase().includes("CTR")) return;
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.Callsign.toUpperCase().endsWith(onlineController.callsign.toUpperCase().slice(-3)));
// If nothing found, continue.
if (!frequencySectors) return;
var extendedSector;
Expand Down

0 comments on commit 98370f3

Please sign in to comment.