mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-09-28 07:10:29 +02:00
abm -> node timer 2
This commit is contained in:
parent
ee4ddbfb9e
commit
58238284b8
|
@ -50,6 +50,7 @@ local torch_selectionbox =
|
||||||
}
|
}
|
||||||
|
|
||||||
local torch_update = function(pos)
|
local torch_update = function(pos)
|
||||||
|
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local is_powered = false
|
local is_powered = false
|
||||||
for _, rule in ipairs(torch_get_input_rules(node)) do
|
for _, rule in ipairs(torch_get_input_rules(node)) do
|
||||||
|
@ -59,16 +60,15 @@ local torch_update = function(pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if is_powered then
|
if is_powered and node.name == "mesecons_torch:mesecon_torch_on" then
|
||||||
if node.name == "mesecons_torch:mesecon_torch_on" then
|
|
||||||
minetest.swap_node(pos, {name = "mesecons_torch:mesecon_torch_off", param2 = node.param2})
|
minetest.swap_node(pos, {name = "mesecons_torch:mesecon_torch_off", param2 = node.param2})
|
||||||
mesecon.receptor_off(pos, torch_get_output_rules(node))
|
mesecon.receptor_off(pos, torch_get_output_rules(node))
|
||||||
end
|
|
||||||
elseif node.name == "mesecons_torch:mesecon_torch_off" then
|
elseif node.name == "mesecons_torch:mesecon_torch_off" then
|
||||||
minetest.swap_node(pos, {name = "mesecons_torch:mesecon_torch_on", param2 = node.param2})
|
minetest.swap_node(pos, {name = "mesecons_torch:mesecon_torch_on", param2 = node.param2})
|
||||||
mesecon.receptor_on(pos, torch_get_output_rules(node))
|
mesecon.receptor_on(pos, torch_get_output_rules(node))
|
||||||
end
|
end
|
||||||
return true
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node("mesecons_torch:mesecon_torch_off", {
|
minetest.register_node("mesecons_torch:mesecon_torch_off", {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user