mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
GROUP - changes in GetDCSGroup
This commit is contained in:
parent
4762793adc
commit
ed9c14e63d
@ -715,21 +715,20 @@ function GROUP:GetDCSUnit( UnitNumber )
|
||||
|
||||
if DCSGroup then
|
||||
|
||||
local UnitFound = nil
|
||||
-- 2.7.1 dead event bug, return the first alive unit instead
|
||||
local units = DCSGroup:getUnits() or {}
|
||||
if DCSGroup.getUnit and DCSGroup:getUnit( UnitNumber ) then
|
||||
return DCSGroup:getUnit( UnitNumber )
|
||||
else
|
||||
|
||||
for _,_unit in pairs(units) do
|
||||
|
||||
local UnitFound = UNIT:Find(_unit)
|
||||
local UnitFound = nil
|
||||
-- 2.7.1 dead event bug, return the first alive unit instead
|
||||
local units = DCSGroup:getUnits() or {}
|
||||
|
||||
if UnitFound then
|
||||
|
||||
return UnitFound
|
||||
|
||||
for _,_unit in pairs(units) do
|
||||
if _unit and _unit:isExist() then
|
||||
return _unit
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return nil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user