Final updates

This commit is contained in:
FlightControl
2017-01-17 12:19:35 +01:00
parent b9c85d4cb7
commit 1206c51fe1
110 changed files with 13026 additions and 336 deletions

View File

@@ -277,7 +277,7 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime )
if DCSControllable then
local Controller = self:_GetController()
self:E(Controller)
self:T3( Controller )
-- When a controllable SPAWNs, it takes about a second to get the controllable in the simulator. Setting tasks to unspawned controllables provides unexpected results.
-- Therefore we schedule the functions to set the mission and options for the Controllable.
@@ -2275,6 +2275,4 @@ function CONTROLLABLE:WayPointExecute( WayPoint, WaitTime )
return self
end
-- Message APIs
-- Message APIs

View File

@@ -879,4 +879,30 @@ function GROUP:CalculateThreatLevelA2G()
return MaxThreatLevelA2G
end
--- Returns true if the first unit of the GROUP is in the air.
-- @param Wrapper.Group#GROUP self
-- @return #boolean true if in the first unit of the group is in the air.
-- @return #nil The GROUP is not existing or not alive.
function GROUP:InAir()
self:F2( self.GroupName )
local DCSGroup = self:GetDCSObject()
if DCSGroup then
local DCSUnit = DCSGroup:getUnit(1)
if DCSUnit then
local GroupInAir = DCSGroup:getUnit(1):inAir()
self:T3( GroupInAir )
return GroupInAir
end
end
return nil
end
function GROUP:OnReSpawn( ReSpawnFunction )
self.ReSpawnFunction = ReSpawnFunction
end

View File

@@ -241,20 +241,13 @@ end
--- Returns true if the POSITIONABLE is in the air.
-- Polymorphic, is overridden in GROUP and UNIT.
-- @param Wrapper.Positionable#POSITIONABLE self
-- @return #boolean true if in the air.
-- @return #nil The POSITIONABLE is not existing or alive.
function POSITIONABLE:InAir()
self:F2( self.PositionableName )
local DCSPositionable = self:GetDCSObject()
if DCSPositionable then
local PositionableInAir = DCSPositionable:inAir()
self:T3( PositionableInAir )
return PositionableInAir
end
return nil
end

View File

@@ -818,3 +818,21 @@ function UNIT:IsShip()
return nil
end
--- Returns true if the UNIT is in the air.
-- @param Wrapper.Positionable#UNIT self
-- @return #boolean true if in the air.
-- @return #nil The UNIT is not existing or alive.
function UNIT:InAir()
self:F2( self.UnitName )
local DCSUnit = self:GetDCSObject()
if DCSUnit then
local UnitInAir = DCSUnit:inAir()
self:T3( UnitInAir )
return UnitInAir
end
return nil
end