From 36f3c26139dabd3e0a902c6a1b5406dc95bf7f0d Mon Sep 17 00:00:00 2001 From: AFCMS Date: Tue, 25 May 2021 00:55:14 +0200 Subject: [PATCH] [walkover] fix warnings --- mods/CORE/walkover/init.lua | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/mods/CORE/walkover/init.lua b/mods/CORE/walkover/init.lua index 220157c8b..6260b43e0 100644 --- a/mods/CORE/walkover/init.lua +++ b/mods/CORE/walkover/init.lua @@ -31,24 +31,21 @@ minetest.register_globalstep(function(dtime) timer = timer + dtime; if timer >= 0.3 then for _,player in pairs(get_connected_players()) do - local pp = player:get_pos() - pp.y = ceil(pp.y) - local loc = vector_add(pp, {x=0,y=-1,z=0}) - if loc ~= nil then - - local nodeiamon = get_node(loc) - - if nodeiamon ~= nil then - if on_walk[nodeiamon.name] then - on_walk[nodeiamon.name](loc, nodeiamon, player) - end - for i = 1, #registered_globals do + local pp = player:get_pos() + pp.y = ceil(pp.y) + local loc = vector_add(pp, {x=0,y=-1,z=0}) + if loc ~= nil then + local nodeiamon = get_node(loc) + if nodeiamon ~= nil then + if on_walk[nodeiamon.name] then + on_walk[nodeiamon.name](loc, nodeiamon, player) + end + for i = 1, #registered_globals do registered_globals[i](loc, nodeiamon, player) - end - end - end - end - + end + end + end + end timer = 0 end end)