aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2013-02-11 09:58:58 +0100
committerkwolekr <kwolekr@minetest.net>2013-03-17 00:23:30 -0400
commitfc5d2074b99d22022d2bf8e693351274bc3f6d09 (patch)
tree6e2f989012bb793a821dc5b505ef98cab58b03fe /builtin
parent10c03e1a9d09ba0369ea3fbff1ec3a9436a3b706 (diff)
downloadminetest-fc5d2074b99d22022d2bf8e693351274bc3f6d09.tar.gz
minetest-fc5d2074b99d22022d2bf8e693351274bc3f6d09.tar.bz2
minetest-fc5d2074b99d22022d2bf8e693351274bc3f6d09.zip
Allow minetest.after to take a variable number of arguments
Diffstat (limited to 'builtin')
-rw-r--r--builtin/misc.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/misc.lua b/builtin/misc.lua
index 496435b33..2cc76e8ec 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(timer.param)
+ timer.func(unpack(timer.args))
table.remove(minetest.timers,index)
end
end
end)
-function minetest.after(time, func, param)
- table.insert(minetest.timers_to_add, {time=time, func=func, param=param})
+function minetest.after(time, func, ...)
+ table.insert(minetest.timers_to_add, {time=time, func=func, args=arg})
end
function minetest.check_player_privs(name, privs)