@@ -538,7 +538,7 @@ function Mod.split_event_type(type)
538
538
return split_event_type
539
539
end
540
540
541
- --- Returns an event template defined in `init.events.defined `.
541
+ --- Returns an event template defined in `init.events`.
542
542
--- @param m down.Mod A reference to the init invoking the function
543
543
--- @param type string A full path to a valid event type (e.g. ` init.events.some_event` )
544
544
--- @return down.Event ?
@@ -561,7 +561,7 @@ function Mod.get_event_template(m, type)
561
561
log .trace (" Returning" .. split_type [2 ] .. " for init" .. split_type [1 ])
562
562
563
563
-- Return the defined event from the specific init
564
- return Mod .loaded_mod [m .name ].events . defined [split_type [2 ]]
564
+ return Mod .loaded_mod [m .name ].events [split_type [2 ]]
565
565
end
566
566
567
567
--- Creates a deep copy of the `mod.base_event` event and returns it with a custom type and referrer.
@@ -606,7 +606,7 @@ function Mod.create_event(m, type, content, ev)
606
606
-- Get the init that contains the event
607
607
local modn = Mod .split_event_type (type )[1 ]
608
608
609
- -- Retrieve the template from init.events.defined
609
+ -- Retrieve the template from init.events
610
610
local event_template =
611
611
Mod .get_event_template (Mod .loaded_mod [modn ] or { name = " " }, type )
612
612
@@ -661,8 +661,8 @@ function Mod.broadcast(event, callback)
661
661
cb .handle (event )
662
662
663
663
for _ , cm in pairs (Mod .loaded_mod ) do
664
- if cm .events . subscribed and cm . events .subscribed [event .split_type [1 ]] then
665
- local evt = cm .events . subscribed [event .split_type [1 ]][event .split_type [2 ]]
664
+ if cm .subscribed and cm .subscribed [event .split_type [1 ]] then
665
+ local evt = cm .subscribed [event .split_type [1 ]][event .split_type [2 ]]
666
666
if evt ~= nil and evt == true then
667
667
cm .on (event )
668
668
end
@@ -687,8 +687,8 @@ function Mod.send_event(recv, ev)
687
687
ev .broadcast = false
688
688
cb .handle (ev )
689
689
local modl = Mod .loaded_mod [recv ]
690
- if modl .events . subscribed and modl . events .subscribed [ev .split_type [1 ]] then
691
- local evt = modl .events . subscribed [ev .split_type [1 ]][ev .split_type [2 ]]
690
+ if modl .subscribed and modl .subscribed [ev .split_type [1 ]] then
691
+ local evt = modl .subscribed [ev .split_type [1 ]][ev .split_type [2 ]]
692
692
if evt ~= nil and evt == true then
693
693
modl .on (ev )
694
694
end
0 commit comments