From 785a297a696ae3baf263cc5730500767114586f7 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Mon, 10 Apr 2017 16:45:37 +0200 Subject: [PATCH] Progress version 2 -- better version ... --- Moose Development/Moose/Core/Event.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Moose Development/Moose/Core/Event.lua b/Moose Development/Moose/Core/Event.lua index bc9bf5807..2cbb12c32 100644 --- a/Moose Development/Moose/Core/Event.lua +++ b/Moose Development/Moose/Core/Event.lua @@ -457,8 +457,7 @@ function EVENT:RemoveForUnit( EventClass, EventID ) local EventClass = EventClass local EventPriority = EventClass:GetEventPriority() - local Event = self.Events[EventID][EventPriority][EventClass] - Event.EventUnit = nil + self.Events[EventID][EventPriority][EventClass] = nil end --- Removes an Events entry for a GROUP. @@ -471,8 +470,7 @@ function EVENT:RemoveForGroup( EventClass, EventID ) local EventClass = EventClass local EventPriority = EventClass:GetEventPriority() - local Event = self.Events[EventID][EventPriority][EventClass] - Event.EventGroup = nil + self.Events[EventID][EventPriority][EventClass] = nil end --- Clears all event subscriptions for a @{Base#BASE} derived object. @@ -850,8 +848,8 @@ function EVENT:onEvent( Event ) if ( Event.IniDCSUnitName and Event.IniDCSGroupName and Event.IniGroupName and EventData.EventGroup ) or ( Event.TgtDCSUnitName and Event.TgtDCSGroupName and Event.TgtGroupName and EventData.EventGroup ) then - local GroupName = EventClass:GetName() - if GroupName then + if EventClass:IsAlive() then + local GroupName = EventClass:GetName() if GroupName == Event.IniDCSGroupName or GroupName == Event.TgtDCSGroupName then -- First test if a EventFunction is Set, otherwise search for the default function if EventData.EventFunction then