Skip to content


Browse files Browse the repository at this point in the history
Revert "Do not send action_off signal when newly placing nodes"
This caused #238, reverting that commit fixes #238.

This reverts commit 30468b0.
  • Loading branch information
Jeija committed Oct 4, 2015
1 parent 0e7f68e commit 24958e2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mesecons/services.lua
Expand Up @@ -28,11 +28,13 @@ mesecon.on_placenode = function (pos, node)
-- Effectors: Send changesignal and activate or deactivate
if mesecon.is_effector( 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) end
if powered then table.insert(powered_rules, r)
else table.insert(unpowered_rules, r) end

local state = powered and mesecon.state.on or
mesecon.changesignal(pos, node, r, state, 1)
Expand All @@ -42,6 +44,10 @@ mesecon.on_placenode = function (pos, node)
for _, r in ipairs(powered_rules) do
mesecon.activate(pos, node, r, 1)
for _, r in ipairs(unpowered_rules) do
mesecon.deactivate(pos, node, r, 1)
Expand Down

0 comments on commit 24958e2

Please sign in to comment.