Fix pistons removing entities when it shouldn't

This commit is contained in:
xyzz 2012-03-18 11:23:23 -04:00 committed by Anthony Zhang
parent 84656e079d
commit ff75bcdcab

View File

@ -201,8 +201,11 @@ mesecon:register_on_signal_off(function (pos, node)
if node.name=="mesecons_pistons:piston_sticky" or node.name=="mesecons_pistons:piston_normal" then 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) local objs = minetest.env:get_objects_inside_radius(pos, 2)
for k, obj in pairs(objs) do for k, obj in pairs(objs) do
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() obj:remove()
end end
end
if node.name=="mesecons_pistons:piston_sticky" then if node.name=="mesecons_pistons:piston_sticky" then
local direction=mesecon:sticky_piston_get_direction(pos) local direction=mesecon:sticky_piston_get_direction(pos)
@ -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 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) local objs = minetest.env:get_objects_inside_radius(pos, 2)
for k, obj in pairs(objs) do for k, obj in pairs(objs) do
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() obj:remove()
end end
end end
end
end) end)