mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 20:11:06 +01:00
Add nil checks
This commit is contained in:
parent
3a24903a01
commit
2ccfd89379
1 changed files with 2 additions and 2 deletions
|
@ -460,7 +460,7 @@ minetest.register_lbm({
|
||||||
run_at_every_load = true,
|
run_at_every_load = true,
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
local reg_biome = mcl_util.get_registered_biome_from_pos(pos)
|
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
|
node.param2 = reg_biome._mcl_grass_palette_index
|
||||||
minetest.set_node(pos, node)
|
minetest.set_node(pos, node)
|
||||||
end
|
end
|
||||||
|
@ -474,7 +474,7 @@ minetest.register_lbm({
|
||||||
run_at_every_load = true,
|
run_at_every_load = true,
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
local reg_biome = mcl_util.get_registered_biome_from_pos(pos)
|
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
|
node.param2 = reg_biome._mcl_foliage_palette_index
|
||||||
minetest.set_node(pos, node)
|
minetest.set_node(pos, node)
|
||||||
elseif node.name == "mcl_core:vine" then
|
elseif node.name == "mcl_core:vine" then
|
||||||
|
|
Loading…
Reference in a new issue