From: PilzAdam Date: Mon, 18 Mar 2013 23:13:00 +0000 (+0100) Subject: Prevent passing nil to unpack() in minetest.after X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=d6026a5fee11722798ddcb1e4d0b5638f16ba9ce;p=zefram%2Fminetest%2Fminetest_engine.git Prevent passing nil to unpack() in minetest.after --- diff --git a/builtin/misc.lua b/builtin/misc.lua index 2cc76e8e..8308b3d6 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)