forked from Mirrorlandia_minetest/mesecons
Fix crash due to force loading changes.
This commit is contained in:
parent
c7428d8135
commit
4b9039266e
@ -357,7 +357,7 @@ end
|
|||||||
|
|
||||||
function mesecon.is_power_on(pos, rulename)
|
function mesecon.is_power_on(pos, rulename)
|
||||||
local node = mesecon.get_node_force(pos)
|
local node = mesecon.get_node_force(pos)
|
||||||
if mesecon.is_conductor_on(node, rulename) or mesecon.is_receptor_on(node.name) then
|
if node and (mesecon.is_conductor_on(node, rulename) or mesecon.is_receptor_on(node.name)) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
@ -365,7 +365,7 @@ end
|
|||||||
|
|
||||||
function mesecon.is_power_off(pos, rulename)
|
function mesecon.is_power_off(pos, rulename)
|
||||||
local node = mesecon.get_node_force(pos)
|
local node = mesecon.get_node_force(pos)
|
||||||
if mesecon.is_conductor_off(node, rulename) or mesecon.is_receptor_off(node.name) then
|
if node and (mesecon.is_conductor_off(node, rulename) or mesecon.is_receptor_off(node.name)) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user