From df209a9f6166a05b072f1cdaa7dc04c61bebb315 Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Sun, 27 Jun 2021 15:06:03 -0700 Subject: [PATCH] removed tests --- .../commands/selectors/sfactor.lua | 20 +------------------ .../commands/selectors/smake.lua | 17 ---------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/worldeditadditions_commands/commands/selectors/sfactor.lua b/worldeditadditions_commands/commands/selectors/sfactor.lua index aecd525..15a10ab 100644 --- a/worldeditadditions_commands/commands/selectors/sfactor.lua +++ b/worldeditadditions_commands/commands/selectors/sfactor.lua @@ -49,10 +49,6 @@ worldedit.register_command("sfactor", { return false, "Error: Invalid \""..targ.."\". Expected \"x\" and or \"y\" and or \"z\"." end - if false then -- Argument test - return false, ": " .. tostring(mode) .. ", : " .. type(fac) .. ", : " .. tostring(targ) - end - return true, mode, fac, targ end, func = function(name, mode, fac, targ) @@ -78,24 +74,10 @@ worldedit.register_command("sfactor", { elseif mode == "shrink" then int = math.floor(abs / fac) * fac else int = math.ceil(abs / fac) * fac end - if int < fac then int = fac end -- Ensure small selections aren't collapsed to 0 - if neg then int = int * -1 end -- Ensure correct facing direction + if neg then int = int * -1 end return int end - --- Test: - if false then - local brk = "" - for k,v in pairs(targ) do - brk = brk..k..": "..delta[k]..", " - delta[k] = eval(delta[k],fac) - brk = brk..k..": "..delta[k]..", " - end - return false, brk - end - -- //multi //fp set1 589 2 -82 //fp set2 615 2 -53 - -- //smake even shrink - for k,v in pairs(targ) do delta[k] = eval(delta[k],fac) end worldedit.pos2[name] = vector.add(p1,delta) diff --git a/worldeditadditions_commands/commands/selectors/smake.lua b/worldeditadditions_commands/commands/selectors/smake.lua index dff331c..d9cb22a 100644 --- a/worldeditadditions_commands/commands/selectors/smake.lua +++ b/worldeditadditions_commands/commands/selectors/smake.lua @@ -61,9 +61,6 @@ worldedit.register_command("smake", { return false, "Error: Invalid operator \""..oper.."\". Expected \"odd\", \"even\" or \"equal\"." end - if false then -- Argument test - return false, ": " .. oper .. ", : " .. tostring(mode) .. ", : " .. tostring(targ) .. ", : " .. tostring(base) - end return true, oper, mode, targ, base end, func = function(name, oper, mode, targ, base) @@ -121,22 +118,8 @@ worldedit.register_command("smake", { if int < 0 then return _m * -1 else return _m end end - -- return false, "Case \"equal\" not handled." end - --- Test: - if false then - local brk = "" - for k,v in pairs(targ) do - brk = brk..k..": "..delta[k]..", " - delta[k] = eval(delta[k]) - brk = brk..k..": "..delta[k]..", " - end - return false, brk - end - -- //multi //fp set1 589 2 -82 //fp set2 615 2 -53 - -- //smake even shrink - for k,v in pairs(targ) do delta[k] = eval(delta[k]) end worldedit.pos2[name] = vector.add(p1,delta)