mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Check for 'action' field in ABMs & LBMs
This commit is contained in:
parent
fe6c666da2
commit
8efa1de835
2 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue