Fix crash for wires next to unknown nodes

This commit is contained in:
Elias Åström 2024-11-18 19:16:43 +01:00 committed by cora
parent b5bd2d411b
commit 0ac265d3b0

View File

@ -110,11 +110,13 @@ local function update_wire(pos)
local pos2 = pos:add(entry.dir)
local node2 = minetest.get_node(pos2)
local ndef2 = minetest.registered_nodes[node2.name]
local redstone = ndef2._mcl_redstone
local connects_to = redstone and redstone.connects_to
if ndef2 then
local redstone = ndef2._mcl_redstone
local connects_to = redstone and redstone.connects_to
if connects_to and connects_to(node2, -entry.dir) then
wireflags = bit.bor(wireflags, entry.mask)
if connects_to and connects_to(node2, -entry.dir) then
wireflags = bit.bor(wireflags, entry.mask)
end
end
end