]> git.lizzy.rs Git - lua_async_mt.git/blobdiff - init.lua
Add source code and include lua_async as submodule
[lua_async_mt.git] / init.lua
diff --git a/init.lua b/init.lua
new file mode 100644 (file)
index 0000000..256e3f0
--- /dev/null
+++ b/init.lua
@@ -0,0 +1,15 @@
+local path = minetest.get_modpath(minetest.get_current_modname()) .. "/src/"
+
+dofile(path .. "init.lua")(path)
+
+minetest.register_globalstep(function(dtime)
+       lua_async.step(dtime)
+end)
+
+function lua_async.mt_validate_objs(...)
+       for _, ref in ipairs {...} do
+               if not ref:is_player() and not ref:get_luaentity() then
+                       coroutine.yield(true)
+               end
+       end
+end