stabilizing fixes

This commit is contained in:
VorTechnix 2024-09-12 17:30:42 -07:00
parent 4ff01bba4e
commit 23aae6959f
No known key found for this signature in database
GPG Key ID: 091E91A69545D5BA
3 changed files with 8 additions and 3 deletions

@ -29,8 +29,9 @@ worldeditadditions_core.register_command("sgrow", {
if not pos2 then wea_c.pos.set(name, 2, pos1)
else pos1, pos2 = Vector3.sort(pos1, pos2) end
pos1, pos2 = pos1:add(min), pos1:add(max)
pos1, pos2 = pos1:add(min), pos2:add(max)
wea_c.pos.clear(name)
wea_c.pos.set_all(name, {pos1, pos2})
return true, "Pos1 set to "..pos1..", Pos2 set to "..pos2
end,

@ -22,10 +22,13 @@ worldeditadditions_core.register_command("srel", {
end,
func = function(name, params_text)
local facing = wea_c.player_dir(name)
local vec = wea_c.parse.directions(params_text, facing, true)
local vec, err = wea_c.parse.directions(params_text, facing, true)
if not vec then return false, err end
local pos1 = wea_c.pos.get(name, 1)
local pos2 = pos1:add(vec)
wea_c.pos.clear(name)
wea_c.pos.set_all(name, {pos1, pos2})
return true, "Pos1 set to "..pos1..", Pos2 set to "..pos2
end,

@ -29,8 +29,9 @@ worldeditadditions_core.register_command("shrink", {
if not pos2 then wea_c.pos.set(name, 2, pos1)
else pos1, pos2 = Vector3.sort(pos1, pos2) end
pos1, pos2 = pos1:add(max), pos1:add(min)
pos1, pos2 = pos1:add(max), pos2:add(min)
wea_c.pos.clear(name)
wea_c.pos.set_all(name, {pos1, pos2})
return true, "Pos1 set to "..pos1..", Pos2 set to "..pos2
end,