summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2015-01-14 23:49:50 -0800
committerAuke Kok <auke-jan.h.kok@intel.com>2015-01-14 23:49:50 -0800
commit7efd6eac9fecac1b9f769c250a2599dd18e53f87 (patch)
tree39403367de73fa48cc867d48da04a71933e44824
parent8d5d1ccbd3ee229132bba131ea567032fa52c1c6 (diff)
Nasty bug to find! Now the main features are functional.
-rw-r--r--init.lua8
1 files changed, 2 insertions, 6 deletions
diff --git a/init.lua b/init.lua
index 735a373..4720d0b 100644
--- a/init.lua
+++ b/init.lua
@@ -356,12 +356,12 @@ local function sed()
end
if lowest < pos.y then
- local tpos = {x = pos.x + o.x, y = lowest, z = pos.z + o.z}
+ local tpos = {x = pos.x + lowesto.x, y = lowest, z = pos.z + lowesto.z}
if not roll(resistance) then
local tnode = minetest.get_node(tpos)
- if node_is_air(tnode) or node_is_plant(tnode) or node_is_liquid(tnode) then
+ if node_is_valid_target_for_displacement(tpos) then
-- time to displace the node from pos to tpos
minetest.place_node(tpos, node)
minetest.get_meta(tpos):from_table(minetest.get_meta(pos):to_table())
@@ -371,14 +371,10 @@ local function sed()
-- fix water at source location
-- fix water at target location
- print("Moved:", node.name, pos.x, pos.y, pos.z, "to:", tnode.name, tpos.x, tpos.y, tpos.z)
stat_displaced = stat_displaced + 1
-- done - don't degrade this block further
return
- else
- --debug
- print("displacement failed: target has something:", tpos.x, tpos.y, tpos.z)
end
end
end