aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorPilzAdam <pilzadam@minetest.net>2013-03-19 00:13:00 +0100
committerPilzAdam <pilzadam@minetest.net>2013-03-19 00:15:41 +0100
commitd6026a5fee11722798ddcb1e4d0b5638f16ba9ce (patch)
tree3bc39229041898ec58d20815b88ab86ec7e4f10b /builtin
parent939397dd6e9cf26358b7e7f07aa58b72b175691f (diff)
downloadminetest-d6026a5fee11722798ddcb1e4d0b5638f16ba9ce.tar.gz
minetest-d6026a5fee11722798ddcb1e4d0b5638f16ba9ce.tar.bz2
minetest-d6026a5fee11722798ddcb1e4d0b5638f16ba9ce.zip
Prevent passing nil to unpack() in minetest.after
Diffstat (limited to 'builtin')
-rw-r--r--builtin/misc.lua4
1 files changed, 2 insertions, 2 deletions
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)