mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Update Positionable.lua
function added to work out if a unit is a submarine
This commit is contained in:
parent
f984ff044b
commit
75849fbfb5
@ -684,6 +684,27 @@ function POSITIONABLE:IsShip()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Returns if the unit is a submarine.
|
||||||
|
-- @param #POSITIONABLE self
|
||||||
|
-- @return #boolean Submarines attributes result.
|
||||||
|
function POSITIONABLE:IsSubmarine()
|
||||||
|
self:F2()
|
||||||
|
|
||||||
|
local DCSUnit = self:GetDCSObject()
|
||||||
|
|
||||||
|
if DCSUnit then
|
||||||
|
local UnitDescriptor = DCSUnit:getDesc()
|
||||||
|
if UnitDescriptor.attributes["Submarines"] == true then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Returns true if the POSITIONABLE is in the air.
|
--- Returns true if the POSITIONABLE is in the air.
|
||||||
-- Polymorphic, is overridden in GROUP and UNIT.
|
-- Polymorphic, is overridden in GROUP and UNIT.
|
||||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||||
@ -817,8 +838,7 @@ end
|
|||||||
-- @return #number The velocity in knots.
|
-- @return #number The velocity in knots.
|
||||||
function POSITIONABLE:GetVelocityKNOTS()
|
function POSITIONABLE:GetVelocityKNOTS()
|
||||||
self:F2( self.PositionableName )
|
self:F2( self.PositionableName )
|
||||||
local velmps=self:GetVelocityMPS()
|
return UTILS.MpsToKnots(self:GetVelocityMPS())
|
||||||
return UTILS.MpsToKnots(velmps)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the Angle of Attack of a positionable.
|
--- Returns the Angle of Attack of a positionable.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user