mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Merge remote-tracking branch 'origin/master' into branch
This commit is contained in:
commit
3bb5d3709b
@ -3152,7 +3152,7 @@ function GROUP:IsSAM()
|
|||||||
local units = self:GetUnits()
|
local units = self:GetUnits()
|
||||||
for _,_unit in pairs(units or {}) do
|
for _,_unit in pairs(units or {}) do
|
||||||
local unit = _unit -- Wrapper.Unit#UNIT
|
local unit = _unit -- Wrapper.Unit#UNIT
|
||||||
if unit:HasSEAD() and unit:IsGround() and (not unit:HasAttribute("Mobile AAA")) then
|
if unit:IsSAM() then
|
||||||
issam = true
|
issam = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@ -3162,18 +3162,16 @@ end
|
|||||||
|
|
||||||
--- [GROUND] Determine if a GROUP has a AAA unit, i.e. has no radar or optical tracker but the AAA = true or the "Mobile AAA" = true attribute.
|
--- [GROUND] Determine if a GROUP has a AAA unit, i.e. has no radar or optical tracker but the AAA = true or the "Mobile AAA" = true attribute.
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
-- @return #boolean IsSAM True if AAA, else false
|
-- @return #boolean IsAAA True if AAA, else false
|
||||||
function GROUP:IsAAA()
|
function GROUP:IsAAA()
|
||||||
local issam = false
|
local isAAA = false
|
||||||
local units = self:GetUnits()
|
local units = self:GetUnits()
|
||||||
for _,_unit in pairs(units or {}) do
|
for _,_unit in pairs(units or {}) do
|
||||||
local unit = _unit -- Wrapper.Unit#UNIT
|
local unit = _unit -- Wrapper.Unit#UNIT
|
||||||
local desc = unit:GetDesc() or {}
|
if unit:IsAAA() then
|
||||||
local attr = desc.attributes or {}
|
isAAA = true
|
||||||
if unit:HasSEAD() then return false end
|
break
|
||||||
if attr["AAA"] or attr["SAM related"] then
|
|
||||||
issam = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return issam
|
return isAAA
|
||||||
end
|
end
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user