From 93567941124694e1733603c9ae1b67ebdeef0152 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 12 Aug 2024 19:05:32 +0200 Subject: [PATCH] bit of performance tuning --- Moose Development/Moose/Wrapper/Group.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 633eb5a32..bd27b6212 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -547,20 +547,22 @@ function GROUP:GetCategoryName() return nil end - --- Returns the coalition of the DCS Group. -- @param #GROUP self -- @return DCS#coalition.side The coalition side of the DCS Group. function GROUP:GetCoalition() - self:F2( self.GroupName ) - - local DCSGroup = self:GetDCSObject() - if DCSGroup then - local GroupCoalition = DCSGroup:getCoalition() - self:T3( GroupCoalition ) - return GroupCoalition + --self:F2( self.GroupName ) + if self.GroupCoalition ~= nil then + return self.GroupCoalition + else + local DCSGroup = self:GetDCSObject() + if DCSGroup then + local GroupCoalition = DCSGroup:getCoalition() + --self:T3( GroupCoalition ) + self.GroupCoalition = GroupCoalition + return GroupCoalition + end end - return nil end