summaryrefslogtreecommitdiff
path: root/mesecons_pistons
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2012-12-27 12:03:05 +0100
committerJeija <norrepli@gmail.com>2012-12-27 12:03:05 +0100
commitd3b77b5be33b7103b5fe3fc07246c903b02b2d90 (patch)
treee5089f59174153ee6bb877f1a4fe8d05d3fe2124 /mesecons_pistons
parentac0fb9113997e87c724ed5ece9e9914936ed6a3b (diff)
downloadmesecons-d3b77b5be33b7103b5fe3fc07246c903b02b2d90.tar
mesecons-d3b77b5be33b7103b5fe3fc07246c903b02b2d90.tar.gz
mesecons-d3b77b5be33b7103b5fe3fc07246c903b02b2d90.tar.bz2
mesecons-d3b77b5be33b7103b5fe3fc07246c903b02b2d90.tar.xz
mesecons-d3b77b5be33b7103b5fe3fc07246c903b02b2d90.zip
Compatibility with old pistons
Diffstat (limited to 'mesecons_pistons')
-rw-r--r--mesecons_pistons/init.lua19
1 files changed, 9 insertions, 10 deletions
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua
index 75547d2..828b466 100644
--- a/mesecons_pistons/init.lua
+++ b/mesecons_pistons/init.lua
@@ -1,8 +1,3 @@
---
---
---
---
-
-- Get mesecon rules of pistons
piston_rules =
{{x=0, y=0, z=1}, --everything apart from z- (pusher side)
@@ -44,8 +39,12 @@ local piston_remove_pusher = function (pos, node)
dir = piston_get_direction(pistonspec.dir, node)
local pusherpos = mesecon:addPosRule(pos, dir)
- minetest.env:remove_node(pusherpos)
- nodeupdate(pusherpos)
+ local pushername = minetest.env:get_node(pusherpos).name
+
+ if pushername == pistonspec.pusher then --make sure there actually is a pusher (for compatibility reasons mainly)
+ minetest.env:remove_node(pusherpos)
+ nodeupdate(pusherpos)
+ end
end
local piston_on = function (pos, node)
@@ -252,7 +251,7 @@ local piston_up_on_box = {
-- Normal
-local pistonspec_normal_down = {
+local pistonspec_normal_up = {
offname = "mesecons_pistons:piston_up_normal_off",
onname = "mesecons_pistons:piston_up_normal_on",
dir = {x = 0, y = 1, z = 0},
@@ -265,7 +264,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_off", {
groups = {cracky = 3, not_in_creative_inventory = 1},
paramtype2 = "facedir",
drop = {"mesecons_pistons:piston_normal_off"},
- mesecons_piston = pistonspec_normal_down,
+ mesecons_piston = pistonspec_normal_up,
mesecons = {effector={
action_on = piston_on,
}}
@@ -282,7 +281,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_on", {
after_dig_node = piston_remove_pusher,
node_box = piston_up_on_box,
selection_box = piston_up_on_box,
- mesecons_piston = pistonspec_normal_down,
+ mesecons_piston = pistonspec_normal_up,
mesecons = {effector={
action_off = piston_off,
}}