-- Further fixes for TASK_CARGO_TRANSPORT

This commit is contained in:
FlightControl_Master 2018-03-29 12:02:07 +02:00
parent 75d179176d
commit 93640b1d8e
2 changed files with 19 additions and 20 deletions

View File

@ -202,26 +202,6 @@ end
-- Get methods
--- Returns the UNITs wrappers of the DCS Units of the Controllable (default is a GROUP).
-- @param #CONTROLLABLE self
-- @return #list<Wrapper.Unit#UNIT> The UNITs wrappers.
function CONTROLLABLE:GetUnits()
self:F2( { self.ControllableName } )
local DCSControllable = self:GetDCSObject()
if DCSControllable then
local DCSUnits = DCSControllable:getUnits()
local Units = {}
for Index, UnitData in pairs( DCSUnits ) do
Units[#Units+1] = UNIT:Find( UnitData )
end
self:T3( Units )
return Units
end
return nil
end
--- Returns the health. Dead controllables have health <= 1.0.
-- @param #CONTROLLABLE self

View File

@ -330,6 +330,25 @@ function GROUP:GetCountry()
return nil
end
--- Returns a list of @{Unit} objects of the @{Group}.
-- @param #GROUP self
-- @return #list<Wrapper.Unit#UNIT> The list of @{Unit} objects of the @{Group}.
function GROUP:GetUnits()
self:F2( { self.GroupName } )
local DCSGroup = self:GetDCSObject()
if DCSGroup then
local DCSUnits = DCSGroup:getUnits()
local Units = {}
for Index, UnitData in pairs( DCSUnits ) do
Units[#Units+1] = UNIT:Find( UnitData )
end
self:T3( Units )
return Units
end
return nil
end
--- Returns the UNIT wrapper class with number UnitNumber.
-- If the underlying DCS Unit does not exist, the method will return nil. .
-- @param #GROUP self