GROUP - changes in GetDCSGroup

This commit is contained in:
Applevangelist 2022-05-22 12:06:45 +02:00
parent 4762793adc
commit ed9c14e63d

View File

@ -715,21 +715,20 @@ function GROUP:GetDCSUnit( UnitNumber )
if DCSGroup then if DCSGroup then
local UnitFound = nil if DCSGroup.getUnit and DCSGroup:getUnit( UnitNumber ) then
-- 2.7.1 dead event bug, return the first alive unit instead return DCSGroup:getUnit( UnitNumber )
local units = DCSGroup:getUnits() or {} else
for _,_unit in pairs(units) do local UnitFound = nil
-- 2.7.1 dead event bug, return the first alive unit instead
local UnitFound = UNIT:Find(_unit) local units = DCSGroup:getUnits() or {}
if UnitFound then for _,_unit in pairs(units) do
if _unit and _unit:isExist() then
return UnitFound return _unit
end
end end
end end
end end
return nil return nil