Bugfix: Check if receptor node is powered from somewhere before turning it off in mesecons:turnoff

This commit is contained in:
Jeija 2012-08-13 22:42:45 +02:00
parent 9f16e4fcaa
commit c58882b0c6

@ -307,7 +307,7 @@ function mesecon:turnoff(pos, sourcepos)
if mesecon:is_effector(node.name) then
if mesecon:effector_inputs(sourcepos, pos) then
mesecon:changesignal(pos)
if mesecon:is_effector_on(node.name) then mesecon:deactivate(pos) end
if mesecon:is_effector_on(node.name) and not mesecon:is_powered(pos) then mesecon:deactivate(pos) end
end
end
end