summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Zhang <azhang9@gmail.com>2012-10-27 12:40:11 -0400
committerAnthony Zhang <azhang9@gmail.com>2012-10-27 12:40:11 -0400
commit3ae31cd849065eaecf1ecb18f28e37a16ce5d44e (patch)
tree949144c69e483f4e38513ce8de777b411ba07f6f
parentff5dcda7c7a2b620f523521effb7ff07c85b1b89 (diff)
downloadmesecons-3ae31cd849065eaecf1ecb18f28e37a16ce5d44e.tar
mesecons-3ae31cd849065eaecf1ecb18f28e37a16ce5d44e.tar.gz
mesecons-3ae31cd849065eaecf1ecb18f28e37a16ce5d44e.tar.bz2
mesecons-3ae31cd849065eaecf1ecb18f28e37a16ce5d44e.tar.xz
mesecons-3ae31cd849065eaecf1ecb18f28e37a16ce5d44e.zip
Use add_node since place_node only works with ItemStacks and can't specify param1/param2 value. This fixes pistons pushing pistons/torches/etc.
-rw-r--r--mesecons_pistons/init.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua
index c1a640d..fa860cc 100644
--- a/mesecons_pistons/init.lua
+++ b/mesecons_pistons/init.lua
@@ -192,7 +192,9 @@ function mesecon:piston_push(pos)
--move the node forward
local nextnode = minetest.env:get_node(pos)
- minetest.env:place_node(pos, checknode)
+ minetest.env:dig_node(checkpos)
+ minetest.env:add_node(pos, checknode)
+ mesecon:updatenode(pos)
checknode = nextnode
end
end
@@ -220,7 +222,8 @@ function mesecon:piston_pull(pos)
and checknode.name ~= "ignore"
and minetest.registered_nodes[checknode.name].liquidtype == "none"
and not mesecon:is_mvps_stopper(checknode.name) then
- minetest.env:place_node(pos, checknode)
+ minetest.env:add_node(pos, checknode)
+ mesecon:updatenode(pos)
minetest.env:dig_node(checkpos)
mesecon:updatenode(checkpos)
end