aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/misc.lua6
-rw-r--r--doc/lua_api.txt4
2 files changed, 5 insertions, 5 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)
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 809d3d9d0..eb05d117e 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -977,9 +977,9 @@ minetest.sound_play(spec, parameters) -> handle
minetest.sound_stop(handle)
Timing:
-minetest.after(time, func, param)
+minetest.after(time, func, ...)
^ Call function after time seconds
-^ param is optional; to pass multiple parameters, pass a table.
+^ Optional: Variable number of arguments that are passed to func
Server:
minetest.request_shutdown() -> request for server shutdown