Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix a few assignments to undeclared globals
  • Loading branch information
sfan5 committed Nov 7, 2017
1 parent 7b1deb1 commit 415000e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion worldedit/manipulations.lua
Expand Up @@ -301,7 +301,7 @@ function worldedit.stack(pos1, pos2, axis, count)
local amount = 0
local copy = worldedit.copy
local i = 1
function next_one()
local function next_one()
if i <= count then
i = i + 1
amount = amount + length
Expand Down
8 changes: 7 additions & 1 deletion worldedit_commands/init.lua
Expand Up @@ -203,7 +203,7 @@ minetest.register_on_punchnode(function(pos, node, puncher)
local name = puncher:get_player_name()
if worldedit.inspect[name] then
local axis, sign = worldedit.player_axis(name)
message = string.format("inspector: %s at %s (param1=%d, param2=%d, received light=%d) punched facing the %s axis",
local message = string.format("inspector: %s at %s (param1=%d, param2=%d, received light=%d) punched facing the %s axis",
node.name, minetest.pos_to_string(pos), node.param1, node.param2, get_node_rlight(pos), axis .. (sign > 0 and "+" or "-"))
worldedit.player_notify(name, message)
end
Expand Down Expand Up @@ -642,6 +642,7 @@ minetest.register_chatcommand("/hollowcylinder", {
end
length = tonumber(length)
if axis == "?" then
local sign
axis, sign = worldedit.player_axis(name)
length = length * sign
end
Expand All @@ -665,6 +666,7 @@ minetest.register_chatcommand("/cylinder", {
end
length = tonumber(length)
if axis == "?" then
local sign
axis, sign = worldedit.player_axis(name)
length = length * sign
end
Expand Down Expand Up @@ -698,6 +700,7 @@ minetest.register_chatcommand("/hollowpyramid", {
local found, _, axis, height, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(.+)$")
height = tonumber(height)
if axis == "?" then
local sign
axis, sign = worldedit.player_axis(name)
height = height * sign
end
Expand All @@ -715,6 +718,7 @@ minetest.register_chatcommand("/pyramid", {
local found, _, axis, height, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(.+)$")
height = tonumber(height)
if axis == "?" then
local sign
axis, sign = worldedit.player_axis(name)
height = height * sign
end
Expand Down Expand Up @@ -762,6 +766,7 @@ minetest.register_chatcommand("/copy", {
end
amount = tonumber(amount)
if axis == "?" then
local sign
axis, sign = worldedit.player_axis(name)
amount = amount * sign
end
Expand Down Expand Up @@ -811,6 +816,7 @@ minetest.register_chatcommand("/stack", {
local found, _, axis, repetitions = param:find("^([xyz%?])%s+([+-]?%d+)$")
repetitions = tonumber(repetitions)
if axis == "?" then
local sign
axis, sign = worldedit.player_axis(name)
repetitions = repetitions * sign
end
Expand Down

0 comments on commit 415000e

Please sign in to comment.