diff options
author | xyzz <unknown@unknown> | 2012-03-18 11:23:23 -0400 |
---|---|---|
committer | Anthony Zhang <azhang9@gmail.com> | 2012-03-18 11:26:54 -0400 |
commit | ff75bcdcab2aab445ca6339b3b76686ef294de86 (patch) | |
tree | 86ec0754b58e2ac57dba1799b974a3f4a574c32c | |
parent | 84656e079d834ab3289d7ba071ee010812948436 (diff) | |
download | mesecons-ff75bcdcab2aab445ca6339b3b76686ef294de86.tar mesecons-ff75bcdcab2aab445ca6339b3b76686ef294de86.tar.gz mesecons-ff75bcdcab2aab445ca6339b3b76686ef294de86.tar.bz2 mesecons-ff75bcdcab2aab445ca6339b3b76686ef294de86.tar.xz mesecons-ff75bcdcab2aab445ca6339b3b76686ef294de86.zip |
Fix pistons removing entities when it shouldn't
-rw-r--r-- | mesecons_pistons/init.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua index 7f4d455..9c15fb3 100644 --- a/mesecons_pistons/init.lua +++ b/mesecons_pistons/init.lua @@ -201,7 +201,10 @@ mesecon:register_on_signal_off(function (pos, node) if node.name=="mesecons_pistons:piston_sticky" or node.name=="mesecons_pistons:piston_normal" then local objs = minetest.env:get_objects_inside_radius(pos, 2) for k, obj in pairs(objs) do - obj:remove() + local obj_name = obj:get_entity_name() + if obj_name == "mesecons_pistons:piston_pusher_normal" or obj_name == "mesecons_pistons:piston_pusher_sticky" then + obj:remove() + end end if node.name=="mesecons_pistons:piston_sticky" then @@ -262,7 +265,10 @@ minetest.register_on_dignode(function(pos, node) if node.name=="mesecons_pistons:piston_normal" or node.name=="mesecons_pistons:piston_sticky" then local objs = minetest.env:get_objects_inside_radius(pos, 2) for k, obj in pairs(objs) do - obj:remove() + local obj_name = obj:get_entity_name() + if obj_name == "mesecons_pistons:piston_pusher_normal" or obj_name == "mesecons_pistons:piston_pusher_sticky" then + obj:remove() + end end end end) |