mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-12-22 19:45:02 +00:00
core: fix register_command and run_command
This commit is contained in:
parent
95c0e96da9
commit
c53fb32d2b
2 changed files with 4 additions and 2 deletions
|
@ -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 a new issue