Skip to content

Commit 2848df0

Browse files
committedFeb 24, 2013
Bugfix: Also deactivate the block two below when digging a pressure plate
1 parent c9e8918 commit 2848df0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
 

‎mesecons_pressureplates/init.lua

+9-3
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ end
3939

4040
-- Register a Pressure Plate
4141
-- offstate: name of the pressure plate when inactive
42-
-- onstate: name of the pressure plate when active
42+
-- onstate: name of the pressure plate when active
4343
-- description: description displayed in the player's inventory
4444
-- tiles_off: textures of the pressure plate when inactive
4545
-- tiles_on: textures of the pressure plate when active
46-
-- image: inventory and wield image of the pressure plate
47-
-- recipe: crafting recipe of the pressure plate
46+
-- image: inventory and wield image of the pressure plate
47+
-- recipe: crafting recipe of the pressure plate
4848

4949
function mesecon:register_pressure_plate(offstate, onstate, description, texture_off, texture_on, recipe)
5050
local ppspec = {
@@ -88,6 +88,12 @@ function mesecon:register_pressure_plate(offstate, onstate, description, texture
8888
on_construct = function(pos)
8989
minetest.env:get_node_timer(pos):start(PRESSURE_PLATE_INTERVAL)
9090
end,
91+
after_dig_node = function(pos)
92+
local two_below = mesecon:addPosRule(pos, {x = 0, y = -2, z = 0})
93+
if not mesecon:connected_to_receptor(two_below) then
94+
mesecon:turnoff(two_below)
95+
end
96+
end
9197
})
9298

9399
minetest.register_craft({

0 commit comments

Comments
 (0)
Please sign in to comment.