fix error in torch behavior

This commit is contained in:
h-v-smacker 2018-12-01 19:41:07 +03:00
parent 58238284b8
commit 70498ae93c
1 changed files with 10 additions and 6 deletions

View File

@ -60,12 +60,16 @@ local torch_update = function(pos)
end end
end end
if is_powered and node.name == "mesecons_torch:mesecon_torch_on" then if is_powered then
minetest.swap_node(pos, {name = "mesecons_torch:mesecon_torch_off", param2 = node.param2}) if node.name == "mesecons_torch:mesecon_torch_on" then
mesecon.receptor_off(pos, torch_get_output_rules(node)) minetest.swap_node(pos, {name = "mesecons_torch:mesecon_torch_off", param2 = node.param2})
elseif node.name == "mesecons_torch:mesecon_torch_off" then mesecon.receptor_off(pos, torch_get_output_rules(node))
minetest.swap_node(pos, {name = "mesecons_torch:mesecon_torch_on", param2 = node.param2}) end
mesecon.receptor_on(pos, torch_get_output_rules(node)) else
if node.name == "mesecons_torch:mesecon_torch_off" then
minetest.swap_node(pos, {name = "mesecons_torch:mesecon_torch_on", param2 = node.param2})
mesecon.receptor_on(pos, torch_get_output_rules(node))
end
end end