Skip to content

Commit

Permalink
Use swap_node instead of add_node when replacing conductors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekdohibs committed Jan 5, 2014
1 parent fb417d4 commit 9c2a5c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mesecons/internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ function mesecon:turnon(pos, rulename)
return
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
local np = mesecon:addPosRule(pos, rule)
Expand Down Expand Up @@ -458,7 +458,7 @@ function mesecon:turnoff(pos, rulename)
return
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
local np = mesecon:addPosRule(pos, rule)
Expand Down

0 comments on commit 9c2a5c3

Please sign in to comment.