From d6026a5fee11722798ddcb1e4d0b5638f16ba9ce Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Tue, 19 Mar 2013 00:13:00 +0100 Subject: Prevent passing nil to unpack() in minetest.after --- builtin/misc.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'builtin') diff --git a/builtin/misc.lua b/builtin/misc.lua index 2cc76e8ec..8308b3d6b 100644 --- a/builtin/misc.lua +++ b/builtin/misc.lua @@ -14,14 +14,14 @@ minetest.register_globalstep(function(dtime) for index, timer in ipairs(minetest.timers) do timer.time = timer.time - dtime if timer.time <= 0 then - timer.func(unpack(timer.args)) + timer.func(unpack(timer.args or {})) table.remove(minetest.timers,index) end end end) function minetest.after(time, func, ...) - table.insert(minetest.timers_to_add, {time=time, func=func, args=arg}) + table.insert(minetest.timers_to_add, {time=time, func=func, args={...}}) end function minetest.check_player_privs(name, privs) -- cgit v1.2.3