mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-27 17:43:53 +01:00
stable axis1 processing
This commit is contained in:
parent
727ee41e72
commit
12e5be8da6
@ -11,10 +11,12 @@ function parse_params_srect(params_text)
|
||||
|
||||
-- If ax1 is bad set to player facing dir
|
||||
if ax1 == len or not ax1:match('[xyz]') then ax1 = "get"
|
||||
else
|
||||
local success, value = wea.getsign(ax1, "int")
|
||||
if not success then return success, value end
|
||||
if not success then return success, value
|
||||
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")
|
||||
@ -54,3 +56,9 @@ worldedit.register_command("srect", {
|
||||
|
||||
-- Tests
|
||||
-- /multi //fp set1 -63 19 -20 //srect 5
|
||||
-- /multi //fp set1 -63 19 -20 //srect z 5
|
||||
-- /multi //fp set1 -63 19 -20 //srect a z 5
|
||||
-- /multi //fp set1 -63 19 -20 //srect z a 5
|
||||
-- /multi //fp set1 -63 19 -20 //srect -z 5
|
||||
-- /multi //fp set1 -63 19 -20 //srect a -x 5
|
||||
-- /multi //fp set1 -63 19 -20 //srect -x -a 5
|
||||
|
Loading…
Reference in New Issue
Block a user