]> git.lizzy.rs Git - lua_async_mt.git/commitdiff
Add documentation
authorElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 6 Aug 2021 18:44:31 +0000 (20:44 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 6 Aug 2021 18:44:31 +0000 (20:44 +0200)
README.md

index d29a0437bf0a4ca8830326d2a37b9fabd5413182..91de317f57d982f3eee47f96e323e1416b1df5c6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,2 +1,11 @@
 # lua_async_mt
 Wrapper for lua_async to use it as a minetest mod.
+Executed the event loop every globalstep.
+
+See https://github.com/EliasFleckenstein03/lua_async for API documentation.
+
+## Utility functions
+
+### `lua_async.mt_validate_objs([obj1, obj2, ...])`
+Must be called from an async function.
+Validates all Minetest ObjectRefs passed as arguments, meaning it checks if they have been removed (in the case of luaentities) or left the game (in the case of players). If one of the refs is not valid, the current thread dies - essentially meaning _this function never returns_ if one of the ObjectRefs is not valid. An error is raised if arguments are given to this function that are not ObjectRefs at all.