Fixed Dead event and Crash event glitch

When a Dead or Crash event happens on UNIT or GROUP level, the
OnEventFunction is also called now!!!
This commit is contained in:
FlightControl 2017-04-11 08:43:03 +02:00
parent 8629b1c36f
commit 96de81fef3

View File

@ -830,7 +830,9 @@ function EVENT:onEvent( Event )
if EventData.EventUnit then
-- So now the EventClass must be a UNIT class!!! We check if it is still "Alive".
if EventClass:IsAlive() then
if EventClass:IsAlive() or
Event.id == EVENTS.Crash or
Event.id == EVENTS.Dead then
local UnitName = EventClass:GetName()
@ -877,7 +879,9 @@ function EVENT:onEvent( Event )
if EventData.EventGroup then
-- So now the EventClass must be a GROUP class!!! We check if it is still "Alive".
if EventClass:IsAlive() then
if EventClass:IsAlive() or
Event.id == EVENTS.Crash or
Event.id == EVENTS.Dead then
-- We can get the name of the EventClass, which is now always a GROUP object.
local GroupName = EventClass:GetName()