Merge branch 'master' into beacons

This commit is contained in:
Grey-Echo
2017-04-20 12:52:09 +02:00
83 changed files with 1849 additions and 41 deletions

View File

@@ -457,4 +457,58 @@ end
function POSITIONABLE:GetBeacon()
self:F2(self)
return BEACON:New(self)
--- Start Lasing a POSITIONABLE
-- @param #POSITIONABLE self
-- @param #POSITIONABLE Target
-- @param #number LaserCode
-- @param #number Duration
-- @return Spot
function POSITIONABLE:LaseUnit( Target, LaserCode, Duration )
self:F2()
LaserCode = LaserCode or math.random( 1000, 9999 )
local RecceDcsUnit = self:GetDCSObject()
local TargetVec3 = Target:GetVec3()
self:E("bulding spot")
self.Spot = SPOT:New( self )
self.Spot:LaseOn( Target:GetPointVec3(), LaserCode, Duration)
return self.Spot
end
--- Stop Lasing a POSITIONABLE
-- @param #POSITIONABLE self
-- @param #POSITIONABLE Target
-- @return #POSITIONABLE
function POSITIONABLE:LaseOff( Target )
self:F2()
local TargetUnitName = Target:GetName()
if self.Spot then
self.Spot:LaseOff()
self.Spot = nil
end
return self
end
--- Check if the POSITIONABLE is lasing a target
-- @param #POSITIONABLE self
-- @return #boolean true if it is lasing a target
function POSITIONABLE:IsLasing()
self:F2()
local Lasing = false
if self.Spot then
Lasing = self.Spot:IsLasing()
end
return Lasing
end