Merge pull request #133 from Novatux/master

Use swap_node instead of add_node when replacing conductors.
This commit is contained in:
Jeija 2014-01-05 01:01:53 -08:00
commit 39361fb719

View File

@ -425,7 +425,7 @@ function mesecon:turnon(pos, rulename)
return return
end end
minetest.add_node(pos, {name = mesecon:get_conductor_on(node, rulename), param2 = node.param2}) minetest.swap_node(pos, {name = mesecon:get_conductor_on(node, rulename), param2 = node.param2})
for _, rule in ipairs(mesecon:rule2meta(rulename, rules)) do for _, rule in ipairs(mesecon:rule2meta(rulename, rules)) do
local np = mesecon:addPosRule(pos, rule) local np = mesecon:addPosRule(pos, rule)
@ -458,7 +458,7 @@ function mesecon:turnoff(pos, rulename)
return return
end end
--]] --]]
minetest.add_node(pos, {name = mesecon:get_conductor_off(node, rulename), param2 = node.param2}) minetest.swap_node(pos, {name = mesecon:get_conductor_off(node, rulename), param2 = node.param2})
for _, rule in ipairs(mesecon:rule2meta(rulename, rules)) do for _, rule in ipairs(mesecon:rule2meta(rulename, rules)) do
local np = mesecon:addPosRule(pos, rule) local np = mesecon:addPosRule(pos, rule)