summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorDS <vorunbekannt75@web.de>2020-10-21 22:05:32 +0200
committerGitHub <noreply@github.com>2020-10-21 21:05:32 +0100
commit9d370b78da61997f46f228cb3e4b54b8ee9295ff (patch)
treeff917dca0410fff1e1607c381451824fff4dc034 /builtin
parent5c0a57f6068000b0414cf2a3ef76a8bf4852b379 (diff)
downloadminetest-9d370b78da61997f46f228cb3e4b54b8ee9295ff.tar.gz
minetest-9d370b78da61997f46f228cb3e4b54b8ee9295ff.tar.bz2
minetest-9d370b78da61997f46f228cb3e4b54b8ee9295ff.zip
Add documentation to builtin core.run_callbacks (#10494)
Diffstat (limited to 'builtin')
-rw-r--r--builtin/client/register.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/client/register.lua b/builtin/client/register.lua
index acd36ab36..27a6b02d9 100644
--- a/builtin/client/register.lua
+++ b/builtin/client/register.lua
@@ -4,6 +4,13 @@ core.callback_origins = {}
local getinfo = debug.getinfo
debug.getinfo = nil
+--- Runs given callbacks.
+--
+-- Note: this function is also called from C++
+-- @tparam table callbacks a table with registered callbacks, like `core.registered_on_*`
+-- @tparam number mode a RunCallbacksMode, as defined in src/script/common/c_internal.h
+-- @param ... arguments for the callback
+-- @return depends on mode
function core.run_callbacks(callbacks, mode, ...)
assert(type(callbacks) == "table")
local cb_len = #callbacks