mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Fixed glitch in EVENT with new EventPriority logic
The Init method was wrong. It is fixed now. SPAWN and other event handling will now be correctly processed!
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||
env.info( 'Moose Generation Timestamp: 20170205_0829' )
|
||||
env.info( 'Moose Generation Timestamp: 20170205_1023' )
|
||||
local base = _G
|
||||
|
||||
Include = {}
|
||||
@@ -4229,6 +4229,7 @@ end
|
||||
--- The EVENT structure
|
||||
-- @type EVENT
|
||||
-- @field #EVENT.Events Events
|
||||
-- @extends Core.Base#BASE
|
||||
EVENT = {
|
||||
ClassName = "EVENT",
|
||||
ClassID = 0,
|
||||
@@ -4345,14 +4346,15 @@ function EVENT:Init( EventID, EventClass )
|
||||
|
||||
-- Each event has a subtable of EventClasses, ordered by EventPriority.
|
||||
local EventPriority = EventClass:GetEventPriority()
|
||||
self:E(EventPriority)
|
||||
if not self.Events[EventID][EventPriority] then
|
||||
self.Events[EventID][EventPriority] = {}
|
||||
end
|
||||
|
||||
if not self.Events[EventID][EventClass] then
|
||||
self.Events[EventID][EventClass] = setmetatable( {}, { __mode = "k" } )
|
||||
if not self.Events[EventID][EventPriority][EventClass] then
|
||||
self.Events[EventID][EventPriority][EventClass] = setmetatable( {}, { __mode = "k" } )
|
||||
end
|
||||
return self.Events[EventID][EventClass]
|
||||
return self.Events[EventID][EventPriority][EventClass]
|
||||
end
|
||||
|
||||
--- Removes an Events entry
|
||||
@@ -5010,12 +5012,14 @@ function EVENT:onEvent( Event )
|
||||
Event.WeaponName = Event.Weapon:getTypeName()
|
||||
--Event.WeaponTgtDCSUnit = Event.Weapon:getTarget()
|
||||
end
|
||||
self:E( { _EVENTCODES[Event.id], Event, Event.IniDCSUnitName, Event.TgtDCSUnitName } )
|
||||
|
||||
local Order = _EVENTORDER[Event.id]
|
||||
self:E( { Order = Order } )
|
||||
local PriorityOrder = _EVENTORDER[Event.id]
|
||||
local PriorityBegin = PriorityOrder == -1 and 5 or 1
|
||||
local PriorityEnd = PriorityOrder == -1 and 1 or 5
|
||||
|
||||
self:E( { _EVENTCODES[Event.id], Event, Event.IniDCSUnitName, Event.TgtDCSUnitName, PriorityOrder } )
|
||||
|
||||
for EventPriority = Order == -1 and 5 or 1, Order == -1 and 1 or 5, Order do
|
||||
for EventPriority = PriorityBegin, PriorityEnd, PriorityOrder do
|
||||
|
||||
if self.Events[Event.id][EventPriority] then
|
||||
|
||||
|
||||
Reference in New Issue
Block a user