mirror of
https://github.com/minetest/minetest.git
synced 2025-03-14 14:22:36 +01:00
Add checks for nil in minetest.after
This commit is contained in:
@ -21,6 +21,8 @@ minetest.register_globalstep(function(dtime)
|
||||
end)
|
||||
|
||||
function minetest.after(time, func, ...)
|
||||
assert(tonumber(time) and type(func) == "function",
|
||||
"Invalid minetest.after invocation")
|
||||
table.insert(minetest.timers_to_add, {time=time, func=func, args={...}})
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user