Simplify srect function

This commit is contained in:
VorTechnix 2021-02-28 09:59:09 -08:00
parent 0c4736fbc2
commit 727ee41e72
2 changed files with 5 additions and 2 deletions

View file

@ -58,3 +58,7 @@ function worldeditadditions.getsign(str, type)
else return true, "+" end
end
end
-- For Testing:
-- worldeditadditions = {}
-- print(worldeditadditions.getsign('-y'))

View file

@ -41,8 +41,7 @@ worldedit.register_command("srect", {
func = function(name, axis1, axis2, len)
if axis1 == "get" then axis1 = worldeditadditions.player_axis2d(name) end
local pos1 = worldedit.pos1[name]
local p2 = vector.new(pos1)
local p2 = vector.new(worldedit.pos1[name])
p2[axis1[2]] = p2[axis1[2]] + tonumber(len) * axis1[1]
p2[axis2[2]] = p2[axis2[2]] + tonumber(len) * axis2[1]