mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-09-12 00:56:53 +02:00
Add nil checks
This commit is contained in:
parent
3a24903a01
commit
2ccfd89379
@ -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 New Issue
Block a user