From 79211cf8cbf2ed0609b21d56da5785d105fa5069 Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Sun, 27 Jun 2021 15:11:00 -0700 Subject: [PATCH] collapse check --- worldeditadditions_commands/commands/selectors/sfactor.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worldeditadditions_commands/commands/selectors/sfactor.lua b/worldeditadditions_commands/commands/selectors/sfactor.lua index 15a10ab..cbc32ac 100644 --- a/worldeditadditions_commands/commands/selectors/sfactor.lua +++ b/worldeditadditions_commands/commands/selectors/sfactor.lua @@ -74,7 +74,8 @@ worldedit.register_command("sfactor", { elseif mode == "shrink" then int = math.floor(abs / fac) * fac else int = math.ceil(abs / fac) * fac end - if neg then int = int * -1 end + if int < fac then int = fac end -- Ensure selection doesn't collapse to 0 + if neg then int = int * -1 end -- Ensure correct facing direction return int end