From 68dce2f247b44db6b992e0812421efb452695cb4 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 3 May 2022 08:46:23 +0200 Subject: [PATCH] extra nil checks for dead units --- Moose Development/Moose/Wrapper/Group.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 6b4d1ab34..266e4a483 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -631,7 +631,7 @@ function GROUP:GetUnits() local DCSGroup = self:GetDCSObject() if DCSGroup then - local DCSUnits = DCSGroup:getUnits() + local DCSUnits = DCSGroup:getUnits() or {} local Units = {} for Index, UnitData in pairs( DCSUnits ) do Units[#Units+1] = UNIT:Find( UnitData ) @@ -1052,7 +1052,7 @@ end function GROUP:GetCoordinate() - local Units = self:GetUnits() + local Units = self:GetUnits() or {} for _,_unit in pairs(Units) do local FirstUnit = _unit -- Wrapper.Unit#UNIT