mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-08-20 13:34:05 +02: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.")
|
log_error(cmdname, "The description option is not a string.")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if type(options.parse) ~= "string" then
|
if type(options.parse) ~= "function" then
|
||||||
log_error(cmdname, "The parse option is not a function.")
|
log_error(cmdname, "The parse option is not a function.")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if type(options.func) ~= "string" then
|
if type(options.func) ~= "function" then
|
||||||
log_error(cmdname, "The func option is not a function.")
|
log_error(cmdname, "The func option is not a function.")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
@ -43,6 +43,8 @@ local function run_command(cmdname, options, player_name, paramtext)
|
|||||||
safe_region(player_name, cmdname, function()
|
safe_region(player_name, cmdname, function()
|
||||||
run_command_stage2(player_name, options.func, parse_result)
|
run_command_stage2(player_name, options.func, parse_result)
|
||||||
end)
|
end)
|
||||||
|
else
|
||||||
|
run_command_stage2(player_name, options.func, parse_result)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
run_command_stage2(player_name, options.func, parse_result)
|
run_command_stage2(player_name, options.func, parse_result)
|
||||||
|
Loading…
Reference in New Issue
Block a user