#SET_GROUP - fix for lost event if IniDCSGroup isn't filled

This commit is contained in:
Applevangelist 2025-01-08 13:04:30 +01:00
parent 04f8f6d512
commit 63c68d729b

View File

@ -1538,6 +1538,13 @@ do
local size = 1
if Event.IniDCSGroup then
size = Event.IniDCSGroup:getSize()
elseif Event.IniDCSGroupName then
local grp = Group.getByName(Event.IniDCSGroupName)
if grp then
size = grp:getSize()
end
elseif Object:IsAlive() then
size = Object:CountAliveUnits()
end
if size == 1 then -- Only remove if the last unit of the group was destroyed.
self:Remove( ObjectName )