From f37a2aabcf1b5e14ea19350199859bc660de0a0c Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 30 Jul 2021 19:45:09 +0100 Subject: [PATCH] //forest: Fix redefining variable i in loop --- worldeditadditions/lib/forest.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worldeditadditions/lib/forest.lua b/worldeditadditions/lib/forest.lua index 5294174..c0d3022 100644 --- a/worldeditadditions/lib/forest.lua +++ b/worldeditadditions/lib/forest.lua @@ -40,7 +40,7 @@ function worldeditadditions.forest(pos1, pos2, density_multiplier, sapling_weigh local did_grow = false local new_id_at_pos local new_name_at_pos - for i=1,100 do + for attempt_number=1,100 do bonemeal:on_use( { x = x, y = y, z = z }, 4, @@ -55,7 +55,7 @@ function worldeditadditions.forest(pos1, pos2, density_multiplier, sapling_weigh if not group_cache[new_id_at_pos] then did_grow = true -- 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 if not stats.placed[node_id] then stats.placed[node_id] = 0