File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -17,20 +17,23 @@ pp_on_timer = function (pos, elapsed)
17
17
if not ppspec then return end
18
18
19
19
local objs = minetest .env :get_objects_inside_radius (pos , 1 )
20
+ local two_below = mesecon :addPosRule (pos , {x = 0 , y = - 2 , z = 0 })
20
21
21
22
if objs [1 ] == nil and node .name == ppspec .onstate then
22
23
minetest .env :add_node (pos , {name = ppspec .offstate })
23
24
mesecon :receptor_off (pos )
24
25
-- force deactivation of mesecon two blocks below (hacky)
25
- mesecon :turnoff (mesecon :addPosRule (pos , {x = 0 , y = - 2 , z = 0 }))
26
+ if not mesecon :connected_to_receptor (two_below ) then
27
+ mesecon :turnoff (two_below )
28
+ end
26
29
else
27
30
for k , obj in pairs (objs ) do
28
31
local objpos = obj :getpos ()
29
32
if objpos .y > pos .y - 1 and objpos .y < pos .y then
30
33
minetest .env :add_node (pos , {name = ppspec .onstate })
31
34
mesecon :receptor_on (pos )
32
35
-- force activation of mesecon two blocks below (hacky)
33
- mesecon :turnon (mesecon : addPosRule ( pos , { x = 0 , y = - 2 , z = 0 }) )
36
+ mesecon :turnon (two_below )
34
37
end
35
38
end
36
39
end
You can’t perform that action at this time.
0 commit comments