srect: localify parsing function

This commit is contained in:
Starbeamrainbowlabs 2021-03-01 21:08:32 +00:00
parent 2acc6b3470
commit e1755ce8e1
No known key found for this signature in database
GPG Key ID: 1BE5172E637709C2

@ -3,8 +3,12 @@
-- ███████ ██████ █████ ██ ██
-- ██ ██ ██ ██ ██ ██
-- ███████ ██ ██ ███████ ██████ ██
-- local -- TODO: set this to local once development is finished
function parse_params_srect(params_text)
worldedit.register_command("srect", {
params = "[<axis1> [<axis2>]] <length>",
description = "Set WorldEdit region position 2 at a set distance along 2 axes.",
privs = {worldedit=true},
require_pos = 1,
parse = function(params_text)
local wea = worldeditadditions
local find = wea.split(params_text, "%s", false)
local ax1, ax2, len = find[1], find[2], find[table.maxn(find)]
@ -30,15 +34,6 @@ function parse_params_srect(params_text)
end
return true, ax1, ax2, len
end
worldedit.register_command("srect", {
params = "[<axis1> [<axis2>]] <length>",
description = "Set WorldEdit region position 2 at a set distance along 2 axes.",
privs = {worldedit=true},
require_pos = 1,
parse = function(params_text)
local values = {parse_params_srect(params_text)}
return unpack(values)
end,
func = function(name, axis1, axis2, len)
if axis1 == "get" then axis1 = worldeditadditions.player_axis2d(name) end