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!
This commit is contained in:
FlightControl 2017-06-29 14:58:10 +02:00
parent 4b7b042bb1
commit 2f4361c97a

View File

@ -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