Merge remote-tracking branch 'origin/master' into branch

This commit is contained in:
Applevangelist 2025-02-06 16:35:49 +01:00
commit b394622b92
2 changed files with 17 additions and 2 deletions

View File

@ -357,7 +357,7 @@ function CLEANUP_AIRBASE.__:EventAddForCleanUp( Event )
self:F({Event})
if Event.IniDCSUnit and Event.IniCategory == Object.Category.UNIT then
if Event.IniDCSUnit and Event.IniUnit and Event.IniCategory == Object.Category.UNIT then
if self.CleanUpList[Event.IniDCSUnitName] == nil then
if self:IsInAirbase( Event.IniUnit:GetVec2() ) then
self:AddForCleanUp( Event.IniUnit, Event.IniDCSUnitName )
@ -365,7 +365,7 @@ function CLEANUP_AIRBASE.__:EventAddForCleanUp( Event )
end
end
if Event.TgtDCSUnit and Event.TgtCategory == Object.Category.UNIT then
if Event.TgtDCSUnit and Event.TgtUnit and Event.TgtCategory == Object.Category.UNIT then
if self.CleanUpList[Event.TgtDCSUnitName] == nil then
if self:IsInAirbase( Event.TgtUnit:GetVec2() ) then
self:AddForCleanUp( Event.TgtUnit, Event.TgtDCSUnitName )

View File

@ -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