Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
fc5d2074
Commit
fc5d2074
authored
12 years ago
by
Jeija
Committed by
kwolekr
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow minetest.after to take a variable number of arguments
parent
10c03e1a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
builtin/misc.lua
+3
-3
3 additions, 3 deletions
builtin/misc.lua
doc/lua_api.txt
+2
-2
2 additions, 2 deletions
doc/lua_api.txt
with
5 additions
and
5 deletions
builtin/misc.lua
+
3
−
3
View file @
fc5d2074
...
...
@@ -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
.
p
ar
am
)
timer
.
func
(
unpack
(
timer
.
ar
gs
)
)
table.remove
(
minetest
.
timers
,
index
)
end
end
end
)
function
minetest
.
after
(
time
,
func
,
param
)
table.insert
(
minetest
.
timers_to_add
,
{
time
=
time
,
func
=
func
,
p
ar
am
=
param
})
function
minetest
.
after
(
time
,
func
,
...
)
table.insert
(
minetest
.
timers_to_add
,
{
time
=
time
,
func
=
func
,
ar
gs
=
arg
})
end
function
minetest
.
check_player_privs
(
name
,
privs
)
...
...
This diff is collapsed.
Click to expand it.
doc/lua_api.txt
+
2
−
2
View file @
fc5d2074
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment