mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-30 19:13:53 +01:00
//forest: Fix redefining variable i in loop
This commit is contained in:
parent
c6bae3b7e0
commit
f37a2aabcf
@ -40,7 +40,7 @@ function worldeditadditions.forest(pos1, pos2, density_multiplier, sapling_weigh
|
|||||||
local did_grow = false
|
local did_grow = false
|
||||||
local new_id_at_pos
|
local new_id_at_pos
|
||||||
local new_name_at_pos
|
local new_name_at_pos
|
||||||
for i=1,100 do
|
for attempt_number=1,100 do
|
||||||
bonemeal:on_use(
|
bonemeal:on_use(
|
||||||
{ x = x, y = y, z = z },
|
{ x = x, y = y, z = z },
|
||||||
4,
|
4,
|
||||||
@ -55,7 +55,7 @@ function worldeditadditions.forest(pos1, pos2, density_multiplier, sapling_weigh
|
|||||||
if not group_cache[new_id_at_pos] then
|
if not group_cache[new_id_at_pos] then
|
||||||
did_grow = true
|
did_grow = true
|
||||||
-- Log the number of attempts it took to grow
|
-- Log the number of attempts it took to grow
|
||||||
table.insert(stats.attempts, i)
|
table.insert(stats.attempts, attempt_number)
|
||||||
-- Update the running total of saplings that grew
|
-- Update the running total of saplings that grew
|
||||||
if not stats.placed[node_id] then
|
if not stats.placed[node_id] then
|
||||||
stats.placed[node_id] = 0
|
stats.placed[node_id] = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user