]> git.lizzy.rs Git - worldedit.git/blobdiff - worldedit_commands/init.lua
Fix a few assignments to undeclared globals
[worldedit.git] / worldedit_commands / init.lua
index 6b6d2a7a35e495cbc4ddd5303c5a4341411a4b3a..07224c1d6a5ac430d550875b5b2036201342e0f9 100644 (file)
@@ -203,7 +203,7 @@ minetest.register_on_punchnode(function(pos, node, puncher)
        local name = puncher:get_player_name()\r
        if worldedit.inspect[name] then\r
                local axis, sign = worldedit.player_axis(name)\r
-               message = string.format("inspector: %s at %s (param1=%d, param2=%d, received light=%d) punched facing the %s axis",\r
+               local message = string.format("inspector: %s at %s (param1=%d, param2=%d, received light=%d) punched facing the %s axis",\r
                        node.name, minetest.pos_to_string(pos), node.param1, node.param2, get_node_rlight(pos), axis .. (sign > 0 and "+" or "-"))\r
                worldedit.player_notify(name, message)\r
        end\r
@@ -642,6 +642,7 @@ minetest.register_chatcommand("/hollowcylinder", {
                end\r
                length = tonumber(length)\r
                if axis == "?" then\r
+                       local sign\r
                        axis, sign = worldedit.player_axis(name)\r
                        length = length * sign\r
                end\r
@@ -665,6 +666,7 @@ minetest.register_chatcommand("/cylinder", {
                end\r
                length = tonumber(length)\r
                if axis == "?" then\r
+                       local sign\r
                        axis, sign = worldedit.player_axis(name)\r
                        length = length * sign\r
                end\r
@@ -698,6 +700,7 @@ minetest.register_chatcommand("/hollowpyramid", {
                local found, _, axis, height, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(.+)$")\r
                height = tonumber(height)\r
                if axis == "?" then\r
+                       local sign\r
                        axis, sign = worldedit.player_axis(name)\r
                        height = height * sign\r
                end\r
@@ -715,6 +718,7 @@ minetest.register_chatcommand("/pyramid", {
                local found, _, axis, height, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(.+)$")\r
                height = tonumber(height)\r
                if axis == "?" then\r
+                       local sign\r
                        axis, sign = worldedit.player_axis(name)\r
                        height = height * sign\r
                end\r
@@ -762,6 +766,7 @@ minetest.register_chatcommand("/copy", {
                end\r
                amount = tonumber(amount)\r
                if axis == "?" then\r
+                       local sign\r
                        axis, sign = worldedit.player_axis(name)\r
                        amount = amount * sign\r
                end\r
@@ -811,6 +816,7 @@ minetest.register_chatcommand("/stack", {
                local found, _, axis, repetitions = param:find("^([xyz%?])%s+([+-]?%d+)$")\r
                repetitions = tonumber(repetitions)\r
                if axis == "?" then\r
+                       local sign\r
                        axis, sign = worldedit.player_axis(name)\r
                        repetitions = repetitions * sign\r
                end\r