From 2f4361c97a155498baf2655c80551e6c4eb71604 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Thu, 29 Jun 2017 14:58:10 +0200 Subject: [PATCH] Fixed dispatching S_EVENT_PLAYER_LEAVE_UNIT fired when no player in unit S_EVENT_PLAYER_LEAVE_UNIT should not be handled when there is no player in the unit! but S_EVENT_MISSION_END should be handled, and also has no initiator! --- Moose Development/Moose/Core/Event.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Core/Event.lua b/Moose Development/Moose/Core/Event.lua index 41b982cea..fa15624ff 100644 --- a/Moose Development/Moose/Core/Event.lua +++ b/Moose Development/Moose/Core/Event.lua @@ -743,7 +743,10 @@ function EVENT:onEvent( Event ) local EventMeta = _EVENTMETA[Event.id] - if self and self.Events and self.Events[Event.id] then + if self and + self.Events and + self.Events[Event.id] and + ( Event.initiator ~= nil or ( Event.initiator == nil and Event.id ~= EVENTS.PlayerLeaveUnit ) ) then if Event.initiator then