From f653f47f262f645e08366fa04286f6a1621439ac Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Tue, 14 Feb 2023 08:36:49 +0000 Subject: [PATCH] Improve the new code somewhat --- mods/MAPGEN/mcl_mapgen_core/init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index 407660ecb..2dc92da5d 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -458,11 +458,10 @@ minetest.register_lbm({ minetest.register_on_generated(function(minp, maxp, blockseed) -- Set correct palette indexes of foliage in brand new mapblocks. local pos1, pos2 = vector.offset(minp, -16, -16, -16), vector.offset(maxp, 16, 16, 16) - local fnode local foliage = minetest.find_nodes_in_area(pos1, pos2, {"group:foliage_palette", "group:foliage_palette_wallmounted"}) for _, fpos in pairs(foliage) do - fnode = minetest.get_node(fpos) - reg_biome = mcl_util.get_registered_biome_from_pos(fpos) + local fnode = minetest.get_node(fpos) + local reg_biome = mcl_util.get_registered_biome_from_pos(fpos) if reg_biome and reg_biome._mcl_foliage_palette_index and fnode.param2 ~= reg_biome._mcl_foliage_palette_index and fnode.name ~= "mcl_core:vine" then fnode.param2 = reg_biome._mcl_foliage_palette_index minetest.set_node(fpos, fnode)