Fix previous commit

This commit is contained in:
Karamel 2020-12-30 14:40:25 +01:00
parent 985262d6cb
commit 918dc7d14c

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