core: make options.nodes_needed optional

This commit is contained in:
Starbeamrainbowlabs 2022-05-16 23:33:22 +01:00
parent f984f5d7b7
commit 19c8d0e7b9
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -26,10 +26,6 @@ local function register_command(cmdname, options)
log_error(cmdname, "The parse option is not a function.")
return false
end
if type(options.nodes_needed) ~= "string" then
log_error(cmdname, "The nodes_needed option is not a function.")
return false
end
if type(options.func) ~= "string" then
log_error(cmdname, "The func option is not a function.")
return false
@ -41,7 +37,7 @@ local function register_command(cmdname, options)
---
if not options.privs then options.privs = {} end
if not options.require_pos then options.require_pos = 0 end
if not options.nodes_needed then options.nodes_needed = function() return 0 end
---
-- 3: Registration