mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-02-17 21:23:44 +01:00
Add nil check
This commit is contained in:
@ -160,16 +160,16 @@ minetest.register_node("mcl_core:vine", {
|
|||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local reg_biome = mcl_util.get_registered_biome_from_pos(pos)
|
local reg_biome = mcl_util.get_registered_biome_from_pos(pos)
|
||||||
if node.name == "mcl_core:vine" then
|
if node.name == "mcl_core:vine" and reg_biome and reg_biome._mcl_foliage_palette_index then
|
||||||
local biome_param2 = reg_biome._mcl_foliage_palette_index
|
local biome_param2 = reg_biome._mcl_foliage_palette_index
|
||||||
local rotation_param2 = node.param2
|
local rotation_param2 = node.param2
|
||||||
local final_param2 = (biome_param2 * 8) + rotation_param2
|
local final_param2 = (biome_param2 * 8) + rotation_param2
|
||||||
if node.param2 ~= final_param2 and rotation_param2 < 6 then
|
if node.param2 ~= final_param2 and rotation_param2 < 6 then
|
||||||
node.param2 = final_param2
|
node.param2 = final_param2
|
||||||
minetest.swap_node(pos, node)
|
minetest.swap_node(pos, node)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
end,
|
|
||||||
|
|
||||||
-- If dug, also dig a “dependant” vine below it.
|
-- If dug, also dig a “dependant” vine below it.
|
||||||
-- A vine is dependant if it hangs from this node and has no supporting block.
|
-- A vine is dependant if it hangs from this node and has no supporting block.
|
||||||
|
Reference in New Issue
Block a user