summaryrefslogtreecommitdiff
path: root/util.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util.lua')
-rw-r--r--util.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/util.lua b/util.lua
index 2c1c967..a74f21f 100644
--- a/util.lua
+++ b/util.lua
@@ -138,6 +138,8 @@ digtron.get_all_digtron_neighbours = function(pos, player)
layout.diggers = {}
layout.builders = {}
layout.extents = {}
+ layout.water_touching = false
+ layout.lava_touching = false
layout.protected = Pointset.create() -- if any nodes we look at are protected, make note of that. That way we don't need to keep re-testing protection state later.
layout.controller = {x=pos.x, y=pos.y, z=pos.z} --Make a deep copy of the pos parameter just in case the calling code wants to play silly buggers with it
@@ -182,6 +184,15 @@ digtron.get_all_digtron_neighbours = function(pos, player)
layout.protected:set(testpos.x, testpos.y, testpos.z, true)
end
+ if minetest.get_item_group(node.name, "water") ~= 0 then
+ layout.water_touching = true
+ elseif minetest.get_item_group(node.name, "lava") ~= 0 then
+ layout.lava_touching = true
+ if digtron.lava_impassible == true then
+ layout.protected:set(testpos.x, testpos.y, testpos.z, true)
+ end
+ end
+
local group_number = minetest.get_item_group(node.name, "digtron")
if group_number > 0 then
--found one. Add it to the digtrons output