From 7fcac6159c38a0ca2a207cd56ef98ff834c79563 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 21 Dec 2025 15:37:34 +0100 Subject: [PATCH] #AWACS - Added INTEL Corridors --- Moose Development/Moose/Ops/Awacs.lua | 59 ++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/Awacs.lua b/Moose Development/Moose/Ops/Awacs.lua index 062f32d7b..61c100bc3 100644 --- a/Moose Development/Moose/Ops/Awacs.lua +++ b/Moose Development/Moose/Ops/Awacs.lua @@ -509,7 +509,7 @@ do -- @field #AWACS AWACS = { ClassName = "AWACS", -- #string - version = "0.2.73", -- #string + version = "0.2.74", -- #string lid = "", -- #string coalition = coalition.side.BLUE, -- #number coalitiontxt = "blue", -- #string @@ -2060,6 +2060,55 @@ function AWACS:SetRejectionZone(Zone,Draw) return self end +--- Function to set corridor zones. +-- @param #AWACS self +-- @param Core.Set#SET_ZONE CorridorZones Can be handed in as SET\_ZONE or single ZONE object. +-- @return #AWACS self +function AWACS:SetCorridorZones(CorridorZones) + self:T(self.lid .. "SetCorridorZones") + if CorridorZones and CorridorZones:IsInstanceOf("SET_ZONE") then + self.corridorzones = CorridorZones + self.usecorridors = true + elseif CorridorZones and CorridorZones:IsInstanceOf("ZONE_BASE") then + if not self.corridorzones then self.corridorzones = SET_ZONE:New() end + self.corridorzones:AddZone(CorridorZones) + self.usecorridors = true + end + return self +end + +--- Function to add one corridor zone. +-- @param #AWACS self +-- @param Core.Zone#ZONE CorridorZone The ZONE object to be added. +-- @return #AWACS self +function AWACS:AddCorridorZone(CorridorZone) + self:T(self.lid .. "AddCorridorZone") + self:SetCorridorZones(CorridorZone) + return self +end + +--- Function to set corridor zone floor and ceiling in FEET. +-- @param #AWACS self +-- @param #number Floor Floor altitude ASL in feet. +-- @param #number Ceiling Ceiling altitude ASL in feet. +-- @return #AWACS self +function AWACS:SetCorridorZoneFloorAndCeiling(Floor,Ceiling) + self.corridorfloor = UTILS.FeetToMeters(Floor) + self.corridorceiling = UTILS.FeetToMeters(Ceiling) + return self +end + +--- Function to set corridor zone floor and ceiling in METERS. +-- @param #AWACS self +-- @param #number Floor Floor altitude ASL in meters. +-- @param #number Ceiling Ceiling altitude ASL in meters. +-- @return #AWACS self +function AWACS:SetCorridorZoneFloorAndCeilingMeters(Floor,Ceiling) + self.corridorfloor = Floor + self.corridorceiling = Ceiling + return self +end + --- [User] Draw a line around the FEZ on the F10 map. -- @param #AWACS self -- @return #AWACS self @@ -4336,6 +4385,14 @@ function AWACS:_StartIntel(awacs) intel:SetFilterCategory({Unit.Category.AIRPLANE,Unit.Category.HELICOPTER}) end + -- Corridors + if self.usecorridors == true then + intel:SetCorridorZones(self.corridorzones) + if self.corridorceiling or self.corridorfloor then + intel:SetCorridorLimits(self.corridorfloor,self.corridorceiling) + end + end + -- Callbacks local function NewCluster(Cluster) self:__NewCluster(5,Cluster)