Skip to content

Commit 5f1fb56

Browse files
committedJan 12, 2013
Rename //dig to //fixlight
1 parent 89e18d6 commit 5f1fb56

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
 

Diff for: ‎worldedit/manipulations.lua

+5-3
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,11 @@ worldedit.rotate = function(pos1, pos2, axis, angle)
304304
return count, pos1, pos2
305305
end
306306

307-
--digs a region defined by positions `pos1` and `pos2`, returning the number of nodes dug
308-
worldedit.dig = function(pos1, pos2)
307+
--Fixes the Lightning in a region defined by positions `pos1` and `pos2`, returning the number of nodes dug
308+
worldedit.fixlight = function(pos1, pos2)
309309
local pos1, pos2 = worldedit.sort_pos(pos1, pos2)
310310
local env = minetest.env
311+
local d = 0
311312

312313
local pos = {x=pos1.x, y=0, z=0}
313314
while pos.x <= pos2.x do
@@ -318,11 +319,12 @@ worldedit.dig = function(pos1, pos2)
318319
local node = env:get_node(pos)
319320
if node.name == "air":
320321
env:dig_node(pos)
322+
d = d + 1
321323
pos.z = pos.z + 1
322324
end
323325
pos.y = pos.y + 1
324326
end
325327
pos.x = pos.x + 1
326328
end
327-
return worldedit.volume(pos1, pos2)
329+
return d
328330
end

Diff for: ‎worldedit_commands/init.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,9 @@ minetest.register_chatcommand("/rotate", {
544544
end,
545545
})
546546

547-
minetest.register_chatcommand("/dig", {
547+
minetest.register_chatcommand("/fixlight", {
548548
params = "",
549-
description = "Dig the current WorldEdit region",
549+
description = "Fix the Lightning in the current WorldEdit region",
550550
privs = {worldedit=true},
551551
func = function(name, param)
552552
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]

0 commit comments

Comments
 (0)
Please sign in to comment.