mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge pull request #2267 from FlightControl-Master/master
merge from master
This commit is contained in:
@@ -831,8 +831,8 @@ do
|
|||||||
-- my_ctld.PackDistance = 35 -- Pack crates in this radius only
|
-- my_ctld.PackDistance = 35 -- Pack crates in this radius only
|
||||||
-- my_ctld.dropcratesanywhere = false -- Option to allow crates to be dropped anywhere.
|
-- my_ctld.dropcratesanywhere = false -- Option to allow crates to be dropped anywhere.
|
||||||
-- my_ctld.dropAsCargoCrate = false -- Hercules only: Parachuted herc cargo is not unpacked automatically but placed as crate to be unpacked. Needs a cargo with the same name defined like the cargo that was dropped.
|
-- my_ctld.dropAsCargoCrate = false -- Hercules only: Parachuted herc cargo is not unpacked automatically but placed as crate to be unpacked. Needs a cargo with the same name defined like the cargo that was dropped.
|
||||||
-- my_ctld.maximumHoverHeight = 15 -- Hover max this high to load.
|
-- my_ctld.maximumHoverHeight = 15 -- Hover max this high to load in meters.
|
||||||
-- my_ctld.minimumHoverHeight = 4 -- Hover min this low to load.
|
-- my_ctld.minimumHoverHeight = 4 -- Hover min this low to load in meters.
|
||||||
-- my_ctld.forcehoverload = true -- Crates (not: troops) can **only** be loaded while hovering.
|
-- my_ctld.forcehoverload = true -- Crates (not: troops) can **only** be loaded while hovering.
|
||||||
-- my_ctld.hoverautoloading = true -- Crates in CrateDistance in a LOAD zone will be loaded automatically if space allows.
|
-- my_ctld.hoverautoloading = true -- Crates in CrateDistance in a LOAD zone will be loaded automatically if space allows.
|
||||||
-- my_ctld.smokedistance = 2000 -- Smoke or flares can be request for zones this far away (in meters).
|
-- my_ctld.smokedistance = 2000 -- Smoke or flares can be request for zones this far away (in meters).
|
||||||
|
|||||||
@@ -5693,15 +5693,22 @@ function CONTROLLABLE:DisableIRMarker()
|
|||||||
self:DisableIRMarkerForGroup()
|
self:DisableIRMarkerForGroup()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.spot then
|
if self.spot then
|
||||||
self.spot:destroy()
|
self.spot:destroy()
|
||||||
self.spot = nil
|
self.spot = nil
|
||||||
|
end
|
||||||
if self.timer and self.timer:IsRunning() then
|
if self.timer and self.timer:IsRunning() then
|
||||||
self.timer:Stop()
|
self.timer:Stop()
|
||||||
self.timer = nil
|
self.timer = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.ClassName == "GROUP" then
|
||||||
|
self.IRMarkerGroup = nil
|
||||||
|
elseif self.ClassName == "UNIT" then
|
||||||
|
self.IRMarkerUnit = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -5709,7 +5716,7 @@ end
|
|||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @return #CONTROLLABLE self
|
-- @return #CONTROLLABLE self
|
||||||
function CONTROLLABLE:EnableIRMarkerForGroup()
|
function CONTROLLABLE:EnableIRMarkerForGroup()
|
||||||
--sefl:F("EnableIRMarkerForGroup")
|
--self:F("EnableIRMarkerForGroup")
|
||||||
if self.ClassName == "GROUP" then
|
if self.ClassName == "GROUP" then
|
||||||
local units = self:GetUnits() or {}
|
local units = self:GetUnits() or {}
|
||||||
for _,_unit in pairs(units) do
|
for _,_unit in pairs(units) do
|
||||||
@@ -5729,6 +5736,7 @@ function CONTROLLABLE:DisableIRMarkerForGroup()
|
|||||||
for _,_unit in pairs(units) do
|
for _,_unit in pairs(units) do
|
||||||
_unit:DisableIRMarker()
|
_unit:DisableIRMarker()
|
||||||
end
|
end
|
||||||
|
self.IRMarkerGroup = nil
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -5737,10 +5745,18 @@ end
|
|||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @return #boolean outcome
|
-- @return #boolean outcome
|
||||||
function CONTROLLABLE:HasIRMarker()
|
function CONTROLLABLE:HasIRMarker()
|
||||||
if self.spot then return true end
|
if self.IRMarkerGroup == true or self.IRMarkerUnit == true then return true end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [Internal] This method is called by the scheduler after disabling the IR marker.
|
||||||
|
function CONTROLLABLE._StopSpot(spot)
|
||||||
|
if spot then
|
||||||
|
spot:destroy()
|
||||||
|
spot=nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--- [Internal] This method is called by the scheduler after enabling the IR marker.
|
--- [Internal] This method is called by the scheduler after enabling the IR marker.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @return #CONTROLLABLE self
|
-- @return #CONTROLLABLE self
|
||||||
@@ -5756,13 +5772,16 @@ function CONTROLLABLE:_MarkerBlink()
|
|||||||
local _, _, unitBBHeight, _ = self:GetObjectSize()
|
local _, _, unitBBHeight, _ = self:GetObjectSize()
|
||||||
local unitPos = self:GetPositionVec3()
|
local unitPos = self:GetPositionVec3()
|
||||||
|
|
||||||
self.spot = Spot.createInfraRed(
|
if not self.spot then
|
||||||
self.DCSUnit,
|
local spot = Spot.createInfraRed(
|
||||||
{ x = 0, y = (unitBBHeight + 1), z = 0 },
|
self.DCSUnit,
|
||||||
{ x = unitPos.x, y = (unitPos.y + unitBBHeight), z = unitPos.z }
|
{ x = 0, y = (unitBBHeight + 1), z = 0 },
|
||||||
)
|
{ x = unitPos.x, y = (unitPos.y + unitBBHeight), z = unitPos.z }
|
||||||
|
)
|
||||||
local offTimer = TIMER:New(function() if self.spot then self.spot:destroy() end end)
|
self.spot = spot
|
||||||
offTimer:Start(0.5)
|
local offTimer = nil
|
||||||
|
local offTimer = TIMER:New(CONTROLLABLE._StopSpot, spot)
|
||||||
|
offTimer:Start(0.5)
|
||||||
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user