Make set palette safer

This commit is contained in:
FossFanatic 2023-01-22 16:51:40 +00:00
parent b77260253a
commit ad25b0bc4b

@ -280,7 +280,7 @@ local function set_palette(minp,maxp,data2,area,biomemap,nodes)
local bn = minetest.get_biome_name(biomemap[b_pos])
if bn then
local biome = minetest.registered_biomes[bn]
if biome and biome._mcl_biome_type then
if biome and biome._mcl_biome_type and biome._mcl_grass_palette_index then
data2[p_pos] = biome._mcl_grass_palette_index
lvm_used = true
end