mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
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:
@@ -830,7 +830,9 @@ function EVENT:onEvent( Event )
|
|||||||
if EventData.EventUnit then
|
if EventData.EventUnit then
|
||||||
|
|
||||||
-- So now the EventClass must be a UNIT class!!! We check if it is still "Alive".
|
-- 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()
|
local UnitName = EventClass:GetName()
|
||||||
|
|
||||||
@@ -877,7 +879,9 @@ function EVENT:onEvent( Event )
|
|||||||
if EventData.EventGroup then
|
if EventData.EventGroup then
|
||||||
|
|
||||||
-- So now the EventClass must be a GROUP class!!! We check if it is still "Alive".
|
-- 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.
|
-- We can get the name of the EventClass, which is now always a GROUP object.
|
||||||
local GroupName = EventClass:GetName()
|
local GroupName = EventClass:GetName()
|
||||||
|
|||||||
Reference in New Issue
Block a user