Revert "only update relevant neighbours"

This reverts commit 197b53d557cc950e25abd57b9d6bcf9f9b0adefe.
This commit is contained in:
Elias Åström 2024-12-09 18:21:56 +01:00
parent f84490df32
commit c243c9719f

View File

@ -304,17 +304,15 @@ function update_neighbours(pos, oldnode, newnode)
for _, dir in pairs(sixdirs) do
local pos2 = pos:add(dir)
local node2 = minetest.get_node(pos2)
if opaque_tab[node2.name] or lwireflag_tab[node.name] or update_tab[node.name] or get_power_tab[node.name] then
local power2 = get_power and get_power(node, dir) or 0
local oldpower2 = old_get_power and old_get_power(oldnode, dir) or 0
if power2 ~= oldpower2 then
local node2 = minetest.get_node(pos2)
local hash2 = minetest.hash_node_position(pos2)
mcl_redstone._pending_updates[hash2] = update_tab[node2.name] and pos2 or nil
if lwireflag_tab[node2.name] then
if wireflag_tab[node2.name] then
update_wire(pos2, oldpower2)
elseif opaque_tab[node2.name] then
for i, dir in pairs(sixdirs) do
@ -323,14 +321,13 @@ function update_neighbours(pos, oldnode, newnode)
local hash3 = minetest.hash_node_position(pos3)
mcl_redstone._pending_updates[hash3] = update_tab[node3.name] and pos3 or nil
if lwireflag_tab[node3.name] then
if wireflag_tab[node3.name] then
update_wire(pos3, math.max(oldpower2, 0))
end
end
end
end
end
end
propagate_wire(clear_queue, fill_queue)
end