srect: minor formatting tidyup

This commit is contained in:
Starbeamrainbowlabs 2021-03-01 21:16:23 +00:00
parent 9f01703744
commit 8cce699313
No known key found for this signature in database
GPG Key ID: 1BE5172E637709C2

@ -6,7 +6,7 @@
worldedit.register_command("srect", {
params = "[<axis1> [<axis2>]] <length>",
description = "Set WorldEdit region position 2 at a set distance along 2 axes.",
privs = {worldedit=true},
privs = { worldedit = true },
require_pos = 1,
parse = function(params_text)
local wea = worldeditadditions
@ -18,14 +18,13 @@ worldedit.register_command("srect", {
else
local success, value = wea.getsign(ax1, "int")
if not success then return success, value
else ax1 = { value, ax1:gsub('[^xyz]',''):sub(1,1) }
end
else ax1 = { value, ax1:gsub('[^xyz]', ''):sub(1, 1) } end
end
-- If ax2 is bad set to +y
if not ax2 or ax2 == len or not ax2:match('[xyz]') then ax2 = "y" end
local success, value = wea.getsign(ax2, "int")
if not success then return success, value end
ax2 = { value, ax2:gsub('[^xyz]',''):sub(1,1) }
ax2 = { value, ax2:gsub('[^xyz]', ''):sub(1, 1) }
len = tonumber(len)
-- If len == nill cancel the operation