mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Progress
This commit is contained in:
@@ -87,16 +87,13 @@ function EVENT:Init( EventID, EventClass )
|
||||
self:F3( { _EVENTCODES[EventID], EventClass } )
|
||||
|
||||
if not self.Events[EventID] then
|
||||
self.Events[EventID] = {}
|
||||
|
||||
-- Create a WEAK table to ensure that the garbage collector is cleaning the event links when the object usage is cleaned.
|
||||
local Meta = {}
|
||||
setmetatable( self.Events[EventID], Meta )
|
||||
Meta.__mode = "k"
|
||||
self.Events[EventID] = setmetatable( {}, { __mode = "k" } )
|
||||
|
||||
end
|
||||
|
||||
if not self.Events[EventID][EventClass] then
|
||||
self.Events[EventID][EventClass] = {}
|
||||
self.Events[EventID][EventClass] = setmetatable( {}, { __mode = "v" } )
|
||||
end
|
||||
return self.Events[EventID][EventClass]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user