mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2025-04-08 17:51:24 +02:00
//erode river: fix redefining i in nested loop
This commit is contained in:
@ -80,14 +80,14 @@ function worldeditadditions.erode.river(heightmap_initial, heightmap, heightmap_
|
|||||||
local action = "none"
|
local action = "none"
|
||||||
if not isedge then
|
if not isedge then
|
||||||
if sides_higher > sides_lower then
|
if sides_higher > sides_lower then
|
||||||
for i,sidecount in ipairs(params.raise_sides) do
|
for _,sidecount in ipairs(params.raise_sides) do
|
||||||
if sidecount == sides_higher then
|
if sidecount == sides_higher then
|
||||||
action = "fill"
|
action = "fill"
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
for i,sidecount in ipairs(params.lower_sides) do
|
for _i,sidecount in ipairs(params.lower_sides) do
|
||||||
if sidecount == sides_lower then
|
if sidecount == sides_lower then
|
||||||
action = "remove"
|
action = "remove"
|
||||||
break
|
break
|
||||||
@ -109,10 +109,10 @@ function worldeditadditions.erode.river(heightmap_initial, heightmap, heightmap_
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for i,hi in ipairs(fill) do
|
for _i,hi in ipairs(fill) do
|
||||||
heightmap[hi] = heightmap[hi] + 1
|
heightmap[hi] = heightmap[hi] + 1
|
||||||
end
|
end
|
||||||
for i,hi in ipairs(remove) do
|
for _i,hi in ipairs(remove) do
|
||||||
heightmap[hi] = heightmap[hi] - 1
|
heightmap[hi] = heightmap[hi] - 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user