From 918dc7d14ccec94610449a8d00c29f767a1ba5a7 Mon Sep 17 00:00:00 2001 From: Karamel Date: Wed, 30 Dec 2020 14:40:25 +0100 Subject: [PATCH] Fix previous commit --- init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 28c6c90..3af6445 100644 --- a/init.lua +++ b/init.lua @@ -74,7 +74,7 @@ end --- Trigger registered callbacks if not already triggered. -- Reset triggered_listeners to be able to recall the callback. local function trigger_player_position_listeners(player, old_pos, pos, trigger_meta) - for name, callback in pairs(player_listeners) do + for name, callback in pairs(poschangelib.player_pos_listeners) do if is_callable(name, pos) then callback(player, old_pos, pos, trigger_meta) set_listener_triggered(name, pos) @@ -86,7 +86,7 @@ end --- Trigger a walk listener by it's name. -- Never called directly, use trigger_player_walk_listener_by_* functions local function trigger_player_walk_listeners(trigger_name, player, pos, node, node_def, trigger_meta) - for listener_name, callback in pairs(walk_listeners[trigger_name]) do + for listener_name, callback in pairs(poschangelib.walk_listeners[trigger_name]) do if is_callable(listener_name, pos) then callback(player, pos, node, node_def, trigger_meta) set_listener_triggered(listener_name, pos) @@ -97,7 +97,7 @@ end --- Check if a walk listener can be triggered by node name and trigger it. -- Trigger meta is copied and extended before being passed to the listeners. local function trigger_player_walk_listeners_by_node_name(player, pos, node, node_def, trigger_meta) - if walk_listeners[node.name] then + if poschangelib.walk_listeners[node.name] then local new_meta = copy_trigger_meta(trigger_meta) new_meta.source = node.name trigger_player_walk_listeners(node.name, player, pos, node, node_def, new_meta) @@ -111,7 +111,7 @@ local function trigger_player_walk_listeners_by_node_group(player, pos, node, no if groups_below then for group, level in pairs(groups_below) do local group_name = 'group:' .. group - if level > 0 and walk_listeners[group_name] then + if level > 0 and poschangelib.walk_listeners[group_name] then local new_meta = copy_trigger_meta(trigger_meta) new_meta.source = group new_meta.source_level = level