From 2ccfd8937924ed35374f3121bdeeddb9b4896060 Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Mon, 13 Feb 2023 15:49:19 +0000 Subject: [PATCH] Add nil checks --- mods/MAPGEN/mcl_mapgen_core/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index d3385ee913..475a9723a8 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -460,7 +460,7 @@ minetest.register_lbm({ run_at_every_load = true, action = function(pos, node) local reg_biome = mcl_util.get_registered_biome_from_pos(pos) - if node.param2 ~= reg_biome._mcl_grass_palette_index then + if reg_biome and reg_biome._mcl_grass_palette_index and node.param2 ~= reg_biome._mcl_grass_palette_index then node.param2 = reg_biome._mcl_grass_palette_index minetest.set_node(pos, node) end @@ -474,7 +474,7 @@ minetest.register_lbm({ run_at_every_load = true, action = function(pos, node) local reg_biome = mcl_util.get_registered_biome_from_pos(pos) - if node.param2 ~= reg_biome._mcl_foliage_palette_index and node.name ~= "mcl_core:vine" then + if reg_biome and reg_biome._mcl_foliage_palette_index and node.param2 ~= reg_biome._mcl_foliage_palette_index and node.name ~= "mcl_core:vine" then node.param2 = reg_biome._mcl_foliage_palette_index minetest.set_node(pos, node) elseif node.name == "mcl_core:vine" then