From 23aae6959f105a3ce81e5e9a099d4f59907b6042 Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:30:42 -0700 Subject: [PATCH] stabilizing fixes --- worldeditadditions_commands/commands/selectors/sgrow.lua | 3 ++- worldeditadditions_commands/commands/selectors/srel.lua | 5 ++++- worldeditadditions_commands/commands/selectors/sshrink.lua | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/worldeditadditions_commands/commands/selectors/sgrow.lua b/worldeditadditions_commands/commands/selectors/sgrow.lua index cf08490..2e86b5a 100644 --- a/worldeditadditions_commands/commands/selectors/sgrow.lua +++ b/worldeditadditions_commands/commands/selectors/sgrow.lua @@ -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, diff --git a/worldeditadditions_commands/commands/selectors/srel.lua b/worldeditadditions_commands/commands/selectors/srel.lua index 214cd82..3c5eb59 100644 --- a/worldeditadditions_commands/commands/selectors/srel.lua +++ b/worldeditadditions_commands/commands/selectors/srel.lua @@ -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, diff --git a/worldeditadditions_commands/commands/selectors/sshrink.lua b/worldeditadditions_commands/commands/selectors/sshrink.lua index 5fce5e9..429b3c8 100644 --- a/worldeditadditions_commands/commands/selectors/sshrink.lua +++ b/worldeditadditions_commands/commands/selectors/sshrink.lua @@ -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,