diff options
author | Anthony Zhang <azhang9@gmail.com> | 2013-05-30 19:05:45 -0400 |
---|---|---|
committer | Anthony Zhang <azhang9@gmail.com> | 2013-05-30 19:13:21 -0400 |
commit | f952ee47401efc2202eb8a1cdfa84ec0d8bd04e2 (patch) | |
tree | 6c58ff7e75c55c30fa4ce0e57eff71b15e185608 /worldedit/manipulations.lua | |
parent | a1dcc432106074d932e699eaa2643c91beb0869d (diff) |
Block queue doesn't lag anymore on slow operations like digging and placing nodes, better and more efficient //fixlight.
Diffstat (limited to 'worldedit/manipulations.lua')
-rw-r--r-- | worldedit/manipulations.lua | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/worldedit/manipulations.lua b/worldedit/manipulations.lua index 71ff61e..b5bcd3c 100644 --- a/worldedit/manipulations.lua +++ b/worldedit/manipulations.lua @@ -397,19 +397,15 @@ worldedit.fixlight = function(pos1, pos2, env) if env == nil then env = minetest.env end
local count = 0
- local pos = {x=pos1.x, y=0, z=0}
+ local pos = {x=pos1.x, y=pos2.y, z=0}
while pos.x <= pos2.x do
- pos.y = pos1.y
- while pos.y <= pos2.y do
- pos.z = pos1.z
- while pos.z <= pos2.z do
- if env:get_node(pos).name == "air" then
- env:dig_node(pos)
- count = count + 1
- end
- pos.z = pos.z + 1
+ pos.z = pos1.z
+ while pos.z <= pos2.z do
+ if env:get_node(pos).name == "air" then
+ env:dig_node(pos)
+ count = count + 1
end
- pos.y = pos.y + 1
+ pos.z = pos.z + 1
end
pos.x = pos.x + 1
end
|