This commit is contained in:
Frank
2020-03-17 16:53:47 +01:00
parent 9cb551e6fa
commit 8823b96b5f
8 changed files with 188 additions and 26 deletions
@@ -90,7 +90,6 @@ end
--- Returns the type name of the DCS Identifiable.
-- @param #IDENTIFIABLE self
-- @return #string The type name of the DCS Identifiable.
-- @return #nil The DCS Identifiable is not existing or alive.
function IDENTIFIABLE:GetTypeName()
self:F2( self.IdentifiableName )
+54
View File
@@ -436,6 +436,60 @@ function UNIT:GetRange()
return nil
end
--- Check if the unit is refuelable. Also retrieves the refuelling system (boom or probe) if applicable.
-- @param #UNIT self
-- @return #boolean If true, unit is refuelable (checks for the attribute "Refuelable").
-- @return #number Refueling system (if any): 0=boom, 1=probe.
function UNIT:IsRefuelable()
self:F2( self.UnitName )
local refuelable=self:HasAttribute("Refuelable")
local system=nil
local Desc=self:GetDesc().attributes
if Desc and Desc.tankerType then
system=Desc.tankerType
end
return refuelable, system
end
--- Check if the unit is a tanker. Also retrieves the refuelling system (boom or probe) if applicable.
-- @param #UNIT self
-- @return #boolean If true, unit is refuelable (checks for the attribute "Refuelable").
-- @return #number Refueling system (if any): 0=boom, 1=probe.
function UNIT:IsTanker()
self:F2( self.UnitName )
local tanker=self:HasAttribute("Tankers")
local system=nil
local Desc=self:GetDesc().attributes
if Desc and Desc.tankerType then
system=Desc.tankerType
end
local typename=self:GetTypeName()
if typename=="IL-78M" then
system=1 --probe
elseif typename=="KC130" then
system=-1 --?
elseif typename=="KC135BDA" then
system=-1 --?
elseif typename=="KC135BDA" then
system=-1 --?
elseif typename=="KC135MPRS" then
system=0 --boom
elseif typename=="S-3B Tanker" then
system=1 --probe
end
return tanker, system
end
--- Returns the unit's group if it exist and nil otherwise.
-- @param Wrapper.Unit#UNIT self
-- @return Wrapper.Group#GROUP The Group of the Unit.