mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-30 11:04:00 +01:00
core: fix register_command and run_command
This commit is contained in:
parent
95c0e96da9
commit
c53fb32d2b
@ -25,11 +25,11 @@ local function register_command(cmdname, options)
|
||||
log_error(cmdname, "The description option is not a string.")
|
||||
return false
|
||||
end
|
||||
if type(options.parse) ~= "string" then
|
||||
if type(options.parse) ~= "function" then
|
||||
log_error(cmdname, "The parse option is not a function.")
|
||||
return false
|
||||
end
|
||||
if type(options.func) ~= "string" then
|
||||
if type(options.func) ~= "function" then
|
||||
log_error(cmdname, "The func option is not a function.")
|
||||
return false
|
||||
end
|
||||
|
@ -43,6 +43,8 @@ local function run_command(cmdname, options, player_name, paramtext)
|
||||
safe_region(player_name, cmdname, function()
|
||||
run_command_stage2(player_name, options.func, parse_result)
|
||||
end)
|
||||
else
|
||||
run_command_stage2(player_name, options.func, parse_result)
|
||||
end
|
||||
else
|
||||
run_command_stage2(player_name, options.func, parse_result)
|
||||
|
Loading…
Reference in New Issue
Block a user