Merge two conditions into one

This commit is contained in:
Jude Melton-Houghton
2021-11-18 19:25:54 -05:00
parent bbc6391e0a
commit 2347519696

View File

@ -383,8 +383,7 @@ local function find_light_update_conductors()
local checked = {} local checked = {}
for name, def in pairs(minetest.registered_nodes) do for name, def in pairs(minetest.registered_nodes) do
local conductor = mesecon.get_conductor(name) local conductor = mesecon.get_conductor(name)
if conductor then if conductor and not checked[name] then
if not checked[name] then
-- Find the other states of the conductor besides the current one. -- Find the other states of the conductor besides the current one.
local other_states local other_states
if conductor.onstate then if conductor.onstate then
@ -415,7 +414,6 @@ local function find_light_update_conductors()
end end
end end
end end
end
-- This is the callback for swap_node_force in turnon and turnoff. It determines -- This is the callback for swap_node_force in turnon and turnoff. It determines
-- whether a conductor node necessitates a lighting update. -- whether a conductor node necessitates a lighting update.