aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorSplizard <quentin@squeezedoranges.com>2012-12-20 10:24:54 +1300
committerPilzAdam <pilzadam@minetest.net>2013-03-19 16:38:56 +0100
commit9b5bb5c7559953db40b52dead3c85e1a1245b4f1 (patch)
tree28f9197723149032f57a44c3ebb4a569c1f8c2f4 /builtin
parent450e7ef0c577f0684f25a35c5ce28ba770979f60 (diff)
downloadminetest-9b5bb5c7559953db40b52dead3c85e1a1245b4f1.tar.gz
minetest-9b5bb5c7559953db40b52dead3c85e1a1245b4f1.tar.bz2
minetest-9b5bb5c7559953db40b52dead3c85e1a1245b4f1.zip
Allow falling nodes to pass through solid "buildable_to" nodes.
Diffstat (limited to 'builtin')
-rw-r--r--builtin/falling.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/falling.lua b/builtin/falling.lua
index d3af36f29..1c09f9856 100644
--- a/builtin/falling.lua
+++ b/builtin/falling.lua
@@ -57,6 +57,10 @@ minetest.register_entity("__builtin:falling_node", {
-- Note: walkable is in the node definition, not in item groups
if minetest.registered_nodes[bcn.name] and
minetest.registered_nodes[bcn.name].walkable then
+ if minetest.registered_nodes[bcn.name].buildable_to then
+ minetest.env:remove_node(bcp)
+ return
+ end
local np = {x=bcp.x, y=bcp.y+1, z=bcp.z}
-- Check what's here
local n2 = minetest.env:get_node(np)
@@ -80,6 +84,7 @@ minetest.register_entity("__builtin:falling_node", {
-- Create node and remove entity
minetest.env:add_node(np, {name=self.nodename})
self.object:remove()
+ nodeupdate(np)
else
-- Do nothing
end
@@ -144,7 +149,8 @@ function nodeupdate_single(p)
n_bottom = minetest.env:get_node(p_bottom)
-- Note: walkable is in the node definition, not in item groups
if minetest.registered_nodes[n_bottom.name] and
- not minetest.registered_nodes[n_bottom.name].walkable then
+ (not minetest.registered_nodes[n_bottom.name].walkable or
+ minetest.registered_nodes[n_bottom.name].buildable_to) then
minetest.env:remove_node(p)
spawn_falling_node(p, n.name)
nodeupdate(p)