summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2013-02-24 19:02:38 +0100
committerJeija <norrepli@gmail.com>2013-02-24 19:03:28 +0100
commit2848df007ee083f40200bbefce892ad7e2bd2c7f (patch)
tree6674c8048dbf7be71607ddeecb4b7b72d3ac11f8
parentc9e89189eb6ea619a228980b62abd0c400cf74b9 (diff)
downloadmesecons-2848df007ee083f40200bbefce892ad7e2bd2c7f.tar
mesecons-2848df007ee083f40200bbefce892ad7e2bd2c7f.tar.gz
mesecons-2848df007ee083f40200bbefce892ad7e2bd2c7f.tar.bz2
mesecons-2848df007ee083f40200bbefce892ad7e2bd2c7f.tar.xz
mesecons-2848df007ee083f40200bbefce892ad7e2bd2c7f.zip
Bugfix: Also deactivate the block two below when digging a pressure plate
-rw-r--r--mesecons_pressureplates/init.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/mesecons_pressureplates/init.lua b/mesecons_pressureplates/init.lua
index 2e80edb..68c9efa 100644
--- a/mesecons_pressureplates/init.lua
+++ b/mesecons_pressureplates/init.lua
@@ -39,12 +39,12 @@ end
-- Register a Pressure Plate
-- offstate: name of the pressure plate when inactive
--- onstate: name of the pressure plate when active
+-- onstate: name of the pressure plate when active
-- description: description displayed in the player's inventory
-- tiles_off: textures of the pressure plate when inactive
-- tiles_on: textures of the pressure plate when active
--- image: inventory and wield image of the pressure plate
--- recipe: crafting recipe of the pressure plate
+-- image: inventory and wield image of the pressure plate
+-- recipe: crafting recipe of the pressure plate
function mesecon:register_pressure_plate(offstate, onstate, description, texture_off, texture_on, recipe)
local ppspec = {
@@ -88,6 +88,12 @@ function mesecon:register_pressure_plate(offstate, onstate, description, texture
on_construct = function(pos)
minetest.env:get_node_timer(pos):start(PRESSURE_PLATE_INTERVAL)
end,
+ after_dig_node = function(pos)
+ local two_below = mesecon:addPosRule(pos, {x = 0, y = -2, z = 0})
+ if not mesecon:connected_to_receptor(two_below) then
+ mesecon:turnoff(two_below)
+ end
+ end
})
minetest.register_craft({