mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-27 17:43:53 +01:00
convolve: fix minor chat command issues
This commit is contained in:
parent
d96f169950
commit
2b32385fdf
@ -9,9 +9,7 @@ worldedit.register_command("convolve", {
|
|||||||
privs = { worldedit = true },
|
privs = { worldedit = true },
|
||||||
require_pos = 2,
|
require_pos = 2,
|
||||||
parse = function(params_text)
|
parse = function(params_text)
|
||||||
if not params_text or params_text == "" then
|
if not params_text then params_text = "" end
|
||||||
return false, "Error: No arguments specified"
|
|
||||||
end
|
|
||||||
|
|
||||||
local parts = worldeditadditions.split(params_text, "%s+", false)
|
local parts = worldeditadditions.split(params_text, "%s+", false)
|
||||||
|
|
||||||
@ -20,7 +18,7 @@ worldedit.register_command("convolve", {
|
|||||||
local height = 5
|
local height = 5
|
||||||
local sigma = nil
|
local sigma = nil
|
||||||
|
|
||||||
if #parts >= 1 then
|
if #parts >= 1 and #parts[1] > 0 then
|
||||||
kernel_name = parts[1]
|
kernel_name = parts[1]
|
||||||
end
|
end
|
||||||
if #parts >= 2 then
|
if #parts >= 2 then
|
||||||
@ -31,7 +29,7 @@ worldedit.register_command("convolve", {
|
|||||||
return false, "Error: Invalid width (it must be a positive odd integer)."
|
return false, "Error: Invalid width (it must be a positive odd integer)."
|
||||||
end
|
end
|
||||||
if #parts_dimension >= 2 then
|
if #parts_dimension >= 2 then
|
||||||
height = tonumber(parts[2])
|
height = tonumber(parts_dimension[2])
|
||||||
if not height then
|
if not height then
|
||||||
return false, "Error: Invalid height (it must be a positive odd integer)."
|
return false, "Error: Invalid height (it must be a positive odd integer)."
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user