summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPilzAdam <adam-k@outlook.com>2012-10-04 20:26:55 +0200
committerPilzAdam <adam-k@outlook.com>2012-10-04 20:26:55 +0200
commit60b15341fa2e449f328bef80ff8781b2d871f285 (patch)
tree2ba9f514ec6c18221cf7941fd0d97d585fc35701
parentc9ef93e758aee2e7de516d892354f9c961e2995d (diff)
Bugfix in pushing items of water
-rw-r--r--init.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/init.lua b/init.lua
index d785c2e..6525aee 100644
--- a/init.lua
+++ b/init.lua
@@ -126,14 +126,15 @@ minetest.register_entity(":__builtin:item", {
local vec = get_flowing_dir(self)
if vec then
+ local v = self.object:getvelocity()
if vec and vec.x-p.x > 0 then
- self.object:setvelocity({x=0.5,y=0,z=0})
+ self.object:setvelocity({x=0.5,y=v.y,z=0})
elseif vec and vec.x-p.x < 0 then
- self.object:setvelocity({x=-0.5,y=0,z=0})
+ self.object:setvelocity({x=-0.5,y=v.y,z=0})
elseif vec and vec.z-p.z > 0 then
- self.object:setvelocity({x=0,y=0,z=0.5})
+ self.object:setvelocity({x=0,y=v.y,z=0.5})
elseif vec and vec.z-p.z < 0 then
- self.object:setvelocity({x=0,y=0,z=-0.5})
+ self.object:setvelocity({x=0,y=v.y,z=-0.5})
end
self.object:setacceleration({x=0, y=-10, z=0})
self.physical_state = true