mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2025-08-15 06:17:22 +00:00
Logistic units can now be DCS StaticUnits or DCS Units. When their life is at zero (destroyed but not removed from the battlefield), no crate can be spawned anymore.
See issue Logistics units and fob are still able to spawn crates even though they are destroyed #50
This commit is contained in:
parent
299af17841
commit
08af1aff18
10
CTLD.lua
10
CTLD.lua
@ -4855,15 +4855,13 @@ function ctld.inLogisticsZone(_heli)
|
||||
if ctld.inAir(_heli) then
|
||||
return false
|
||||
end
|
||||
|
||||
local _heliPoint = _heli:getPoint()
|
||||
|
||||
for _, _name in pairs(ctld.logisticUnits) do
|
||||
|
||||
local _logistic = StaticObject.getByName(_name)
|
||||
|
||||
if _logistic ~= nil and _logistic:getCoalition() == _heli:getCoalition() then
|
||||
|
||||
if not _logistic then
|
||||
_logistic = Unit.getByName(_name)
|
||||
end
|
||||
if _logistic ~= nil and _logistic:getCoalition() == _heli:getCoalition() and _logistic:getLife() > 0 then
|
||||
--get distance
|
||||
local _dist = ctld.getDistance(_heliPoint, _logistic:getPoint())
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user