Update misc.lua

Little snippet from sfan5 to help identify problem mods that crash the server when nil is sent through the after function
This commit is contained in:
Ryan 2014-04-13 11:52:58 +01:00
parent af01a9577e
commit 597a9857c4
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,10 @@ minetest.register_globalstep(function(dtime)
end)
function minetest.after(time, func, ...)
-- Little snippet from sfan5 to help identify problem mods that crash the server when nil is sent through the after function
if time == nil or func == nil then
minetest.log("ERROR", "invalid minetest.after call by "..minetest.get_current_modname())
end
table.insert(minetest.timers_to_add, {time=time, func=func, args={...}})
end