Skip to content

Commit

Permalink
Merge pull request #19 from azfv/master
Browse files Browse the repository at this point in the history
Enforce extending to the same position type only
  • Loading branch information
Kahn authored May 1, 2024
2 parents 395e91a + c384e98 commit 7bddbbb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ Sector -> Volumes(VolumeName)
Volumes.xml
Meta -> Line
Volume(Name) -> Boundaries(Name)
Volume(ARA) -> Boundaries(ARAFURA)
Volume(ARA) -> Boundaries(ARAFURA)
8 changes: 4 additions & 4 deletions atc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -350,4 +350,4 @@ function getDistanceInKm(sector1, sector2) {

function deg2rad(deg) {
return deg * (Math.PI/180)
}
}

0 comments on commit 7bddbbb

Please sign in to comment.