diff options
author | ShadowNinja <shadowninja@minetest.net> | 2014-04-13 17:50:46 -0400 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2014-04-13 17:54:00 -0400 |
commit | dcafad2f736aa9b7174bdf7313735d89b981e0c6 (patch) | |
tree | ac4e37559ca617c07adbfa6e60090ecbec4896dc /builtin | |
parent | b04872d96b54f0a22a972d3a0f16ccef84972d3f (diff) | |
download | minetest-dcafad2f736aa9b7174bdf7313735d89b981e0c6.tar.gz minetest-dcafad2f736aa9b7174bdf7313735d89b981e0c6.tar.bz2 minetest-dcafad2f736aa9b7174bdf7313735d89b981e0c6.zip |
Add checks for nil in minetest.after
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/misc.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/misc.lua b/builtin/misc.lua index 1d5e146c6..f91f5e095 100644 --- a/builtin/misc.lua +++ b/builtin/misc.lua @@ -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 |