]> git.lizzy.rs Git - worldedit.git/commitdiff
Fix a few assignments to undeclared globals
authorsfan5 <sfan5@live.de>
Tue, 7 Nov 2017 13:19:57 +0000 (14:19 +0100)
committersfan5 <sfan5@live.de>
Tue, 7 Nov 2017 13:19:57 +0000 (14:19 +0100)
worldedit/manipulations.lua
worldedit_commands/init.lua

index 995619c39c58f7694604a5ea18e39d8ce1f2988d..ee5156137ab780fbe131de0cad6044ecd2fcbb32 100644 (file)
@@ -301,7 +301,7 @@ function worldedit.stack(pos1, pos2, axis, count)
        local amount = 0\r
        local copy = worldedit.copy\r
        local i = 1\r
-       function next_one()\r
+       local function next_one()\r
                if i <= count then\r
                        i = i + 1\r
                        amount = amount + length\r
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