Add checks for nil in minetest.after

stable-0.4
ShadowNinja 2014-04-13 17:50:46 -04:00
parent b04872d96b
commit dcafad2f73
1 changed files with 2 additions and 0 deletions

View File

@ -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