Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix bug that made delayers oscillate their input port
when powering off the delayer faster than the delay time.
Actually, delayers should have never worked since the ActionQueue update as
they always used the default rules for their output, which is obviously nonsense.
  • Loading branch information
Jeija committed Mar 23, 2014
1 parent 1852e96 commit 1f66687
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mesecons_delayer/init.lua
Expand Up @@ -21,14 +21,14 @@ local delayer_activate = function(pos, node)
local def = minetest.registered_nodes[node.name]
local time = def.delayer_time
minetest.swap_node(pos, {name = def.delayer_onstate, param2=node.param2})
mesecon.queue:add_action(pos, "receptor_on", {rules=delayer_get_output_rules(node)}, time, nil)
mesecon.queue:add_action(pos, "receptor_on", {delayer_get_output_rules(node)}, time, nil)
end

local delayer_deactivate = function(pos, node)
local def = minetest.registered_nodes[node.name]
local time = def.delayer_time
minetest.swap_node(pos, {name = def.delayer_offstate, param2=node.param2})
mesecon.queue:add_action(pos, "receptor_off", {rules=delayer_get_output_rules(node)}, time, nil)
mesecon.queue:add_action(pos, "receptor_off", {delayer_get_output_rules(node)}, time, nil)
end

-- Register the 2 (states) x 4 (delay times) delayers
Expand Down

0 comments on commit 1f66687

Please sign in to comment.