aboutsummaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorSmallJoker <mk939@ymail.com>2019-07-27 20:55:38 +0200
committerSmallJoker <mk939@ymail.com>2019-07-27 21:13:47 +0200
commit8efa1de8356630f2943e3d74e7287b5e976e8706 (patch)
treec3f541a68bd8e65a5257c6d6b32520a0bb54bcc5 /builtin/game
parentfe6c666da26e08b726bd21f34d25558cf456bd1f (diff)
downloadminetest-8efa1de8356630f2943e3d74e7287b5e976e8706.tar.gz
minetest-8efa1de8356630f2943e3d74e7287b5e976e8706.tar.bz2
minetest-8efa1de8356630f2943e3d74e7287b5e976e8706.zip
Check for 'action' field in ABMs & LBMs
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/register.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/game/register.lua b/builtin/game/register.lua
index d111e5c27..51492e928 100644
--- a/builtin/game/register.lua
+++ b/builtin/game/register.lua
@@ -79,6 +79,7 @@ end
function core.register_abm(spec)
-- Add to core.registered_abms
+ assert(type(spec.action) == "function", "Required field 'action' of type function")
core.registered_abms[#core.registered_abms + 1] = spec
spec.mod_origin = core.get_current_modname() or "??"
end
@@ -86,6 +87,7 @@ end
function core.register_lbm(spec)
-- Add to core.registered_lbms
check_modname_prefix(spec.name)
+ assert(type(spec.action) == "function", "Required field 'action' of type function")
core.registered_lbms[#core.registered_lbms + 1] = spec
spec.mod_origin = core.get_current_modname() or "??"
end