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

This commit is contained in:
Applevangelist 2023-02-23 10:32:38 +01:00
commit 8c0f960e39
4 changed files with 21 additions and 16 deletions

View File

@ -927,7 +927,7 @@ function ZONE_RADIUS:Scan( ObjectCategories, UnitCategories )
local ZoneCoord = self:GetCoordinate() local ZoneCoord = self:GetCoordinate()
local ZoneRadius = self:GetRadius() local ZoneRadius = self:GetRadius()
self:F({ZoneCoord = ZoneCoord, ZoneRadius = ZoneRadius, ZoneCoordLL = ZoneCoord:ToStringLLDMS()}) --self:F({ZoneCoord = ZoneCoord, ZoneRadius = ZoneRadius, ZoneCoordLL = ZoneCoord:ToStringLLDMS()})
local SphereSearch = { local SphereSearch = {
id = world.VolumeType.SPHERE, id = world.VolumeType.SPHERE,
@ -2924,7 +2924,7 @@ do -- ZONE_ELASTIC
--- Add a set of groups. Positions of the group will be considered as polygon vertices when contructing the convex hull. --- Add a set of groups. Positions of the group will be considered as polygon vertices when contructing the convex hull.
-- @param #ZONE_ELASTIC self -- @param #ZONE_ELASTIC self
-- @param Core.Set#SET_GROUP SetGroup Set of groups. -- @param Core.Set#SET_GROUP GroupSet Set of groups.
-- @return #ZONE_ELASTIC self -- @return #ZONE_ELASTIC self
function ZONE_ELASTIC:AddSetGroup(GroupSet) function ZONE_ELASTIC:AddSetGroup(GroupSet)

View File

@ -2040,9 +2040,9 @@ function UTILS.GenerateUHFrequencies()
local _start = 220000000 local _start = 220000000
while _start < 399000000 do while _start < 399000000 do
if _start ~= 243000000 then if _start ~= 243000000 then
table.insert(FreeUHFFrequencies, _start) table.insert(FreeUHFFrequencies, _start)
end end
_start = _start + 500000 _start = _start + 500000
end end

View File

@ -703,11 +703,11 @@ function POSITIONABLE:IsSubmarine()
if DCSUnit then if DCSUnit then
local UnitDescriptor = DCSUnit:getDesc() local UnitDescriptor = DCSUnit:getDesc()
if UnitDescriptor.attributes["Submarines"] == true then if UnitDescriptor.attributes["Submarines"] == true then
return true return true
else else
return false return false
end end
end end
self:E( { "Cannot check IsSubmarine", Positionable = self, Alive = self:IsAlive() } ) self:E( { "Cannot check IsSubmarine", Positionable = self, Alive = self:IsAlive() } )

View File

@ -89,9 +89,9 @@
-- --
-- @field #UNIT -- @field #UNIT
UNIT = { UNIT = {
ClassName="UNIT", ClassName="UNIT",
UnitName=nil, UnitName=nil,
GroupName=nil, GroupName=nil,
} }
@ -325,14 +325,19 @@ function UNIT:IsAlive()
local DCSUnit = self:GetDCSObject() -- DCS#Unit local DCSUnit = self:GetDCSObject() -- DCS#Unit
if DCSUnit then if DCSUnit then
local UnitIsAlive = DCSUnit:isExist() and DCSUnit:isActive() local UnitIsAlive = DCSUnit:isExist() and DCSUnit:isActive() -- and DCSUnit:getLife() > 1
return UnitIsAlive return UnitIsAlive
end end
return nil return nil
end end
--- Returns if the Unit is dead.
-- @param #UNIT self
-- @return #boolean `true` if Unit is dead, else false or nil if the unit does not exist
function UNIT:IsDead()
return not self:IsAlive()
end
--- Returns the Unit's callsign - the localized string. --- Returns the Unit's callsign - the localized string.
-- @param #UNIT self -- @param #UNIT self
@ -626,7 +631,7 @@ function UNIT:IsFuelSupply()
return false return false
end end
--- Returns the unit's group if it exist and nil otherwise. --- Returns the unit's group if it exists and nil otherwise.
-- @param Wrapper.Unit#UNIT self -- @param Wrapper.Unit#UNIT self
-- @return Wrapper.Group#GROUP The Group of the Unit or `nil` if the unit does not exist. -- @return Wrapper.Group#GROUP The Group of the Unit or `nil` if the unit does not exist.
function UNIT:GetGroup() function UNIT:GetGroup()