diff options
author | Jeija <norrepli@gmail.com> | 2015-02-03 20:07:58 +0100 |
---|---|---|
committer | Jeija <norrepli@gmail.com> | 2015-02-03 20:07:58 +0100 |
commit | 30468b09cf35b3122e05f1e2867923fdcad5a5d2 (patch) | |
tree | 18c5b6ab06c80cddb41f8c02284a461ebbf8e394 | |
parent | a895715720561076ecbf03c2a42de8c8b55aae8f (diff) | |
download | mesecons-30468b09cf35b3122e05f1e2867923fdcad5a5d2.tar mesecons-30468b09cf35b3122e05f1e2867923fdcad5a5d2.tar.gz mesecons-30468b09cf35b3122e05f1e2867923fdcad5a5d2.tar.bz2 mesecons-30468b09cf35b3122e05f1e2867923fdcad5a5d2.tar.xz mesecons-30468b09cf35b3122e05f1e2867923fdcad5a5d2.zip |
Do not send action_off signal when newly placing nodes, this didn't
cause any bugs, but unneccessary sounds (experimental change)
-rw-r--r-- | mesecons/services.lua | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/mesecons/services.lua b/mesecons/services.lua index 215fb31..469ab95 100644 --- a/mesecons/services.lua +++ b/mesecons/services.lua @@ -28,13 +28,11 @@ mesecon.on_placenode = function (pos, node) -- Effectors: Send changesignal and activate or deactivate if mesecon.is_effector(node.name) then local powered_rules = {} - local unpowered_rules = {} -- for each input rule, check if powered for _, r in ipairs(mesecon.effector_get_rules(node)) do local powered = mesecon.is_powered(pos, r) - if powered then table.insert(powered_rules, r) - else table.insert(unpowered_rules, r) end + if powered then table.insert(powered_rules, r) end local state = powered and mesecon.state.on or mesecon.state.off mesecon.changesignal(pos, node, r, state, 1) @@ -44,10 +42,6 @@ mesecon.on_placenode = function (pos, node) for _, r in ipairs(powered_rules) do mesecon.activate(pos, node, r, 1) end - else - for _, r in ipairs(unpowered_rules) do - mesecon.deactivate(pos, node, r, 1) - end end end end |