From c79b5c37c4f958f7a85167b51afe8e31a55fccf9 Mon Sep 17 00:00:00 2001 From: Shafik Date: Thu, 6 Feb 2025 13:16:03 +0200 Subject: [PATCH] [ADDED] `UNIT:IsEWR()` --- Moose Development/Moose/Wrapper/Unit.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Moose Development/Moose/Wrapper/Unit.lua b/Moose Development/Moose/Wrapper/Unit.lua index 780616d7e..38b2fe74b 100644 --- a/Moose Development/Moose/Wrapper/Unit.lua +++ b/Moose Development/Moose/Wrapper/Unit.lua @@ -1895,6 +1895,21 @@ function UNIT:IsSAM() return false end +--- [GROUND] Determine if a UNIT is a EWR unit +-- @param #UNIT self +-- @return #boolean IsEWR True if EWR, else false +function UNIT:IsEWR() + if self:IsGround() then + local DCSUnit = self:GetDCSObject() + + if DCSUnit then + local attrs = DCSUnit:getDesc().attributes + return attrs["EWR"] == true + end + end + return false +end + --- [GROUND] Determine if a UNIT is a AAA unit, i.e. has no radar or optical tracker but the AAA = true or the "Mobile AAA" = true attribute. -- @param #UNIT self -- @return #boolean IsAAA True if AAA, else false