Skip to content

Commit 415000e

Browse files
committed
Fix a few assignments to undeclared globals
1 parent 7b1deb1 commit 415000e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

worldedit/manipulations.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ function worldedit.stack(pos1, pos2, axis, count)
301301
local amount = 0
302302
local copy = worldedit.copy
303303
local i = 1
304-
function next_one()
304+
local function next_one()
305305
if i <= count then
306306
i = i + 1
307307
amount = amount + length

worldedit_commands/init.lua

+7-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ minetest.register_on_punchnode(function(pos, node, puncher)
203203
local name = puncher:get_player_name()
204204
if worldedit.inspect[name] then
205205
local axis, sign = worldedit.player_axis(name)
206-
message = string.format("inspector: %s at %s (param1=%d, param2=%d, received light=%d) punched facing the %s axis",
206+
local message = string.format("inspector: %s at %s (param1=%d, param2=%d, received light=%d) punched facing the %s axis",
207207
node.name, minetest.pos_to_string(pos), node.param1, node.param2, get_node_rlight(pos), axis .. (sign > 0 and "+" or "-"))
208208
worldedit.player_notify(name, message)
209209
end
@@ -642,6 +642,7 @@ minetest.register_chatcommand("/hollowcylinder", {
642642
end
643643
length = tonumber(length)
644644
if axis == "?" then
645+
local sign
645646
axis, sign = worldedit.player_axis(name)
646647
length = length * sign
647648
end
@@ -665,6 +666,7 @@ minetest.register_chatcommand("/cylinder", {
665666
end
666667
length = tonumber(length)
667668
if axis == "?" then
669+
local sign
668670
axis, sign = worldedit.player_axis(name)
669671
length = length * sign
670672
end
@@ -698,6 +700,7 @@ minetest.register_chatcommand("/hollowpyramid", {
698700
local found, _, axis, height, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(.+)$")
699701
height = tonumber(height)
700702
if axis == "?" then
703+
local sign
701704
axis, sign = worldedit.player_axis(name)
702705
height = height * sign
703706
end
@@ -715,6 +718,7 @@ minetest.register_chatcommand("/pyramid", {
715718
local found, _, axis, height, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(.+)$")
716719
height = tonumber(height)
717720
if axis == "?" then
721+
local sign
718722
axis, sign = worldedit.player_axis(name)
719723
height = height * sign
720724
end
@@ -762,6 +766,7 @@ minetest.register_chatcommand("/copy", {
762766
end
763767
amount = tonumber(amount)
764768
if axis == "?" then
769+
local sign
765770
axis, sign = worldedit.player_axis(name)
766771
amount = amount * sign
767772
end
@@ -811,6 +816,7 @@ minetest.register_chatcommand("/stack", {
811816
local found, _, axis, repetitions = param:find("^([xyz%?])%s+([+-]?%d+)$")
812817
repetitions = tonumber(repetitions)
813818
if axis == "?" then
819+
local sign
814820
axis, sign = worldedit.player_axis(name)
815821
repetitions = repetitions * sign
816822
end

0 commit comments

Comments
 (0)