aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-11-02 18:05:42 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-11-02 18:05:42 +0200
commit2863a3291a5cc9be8eeff063cd187a783e58c163 (patch)
treeee2394d803827c57a87b5ab53f50a0872302efee /src
parent8adad36a667bd9dc0bd2c0955858cb3a1883ea05 (diff)
downloadminetest-2863a3291a5cc9be8eeff063cd187a783e58c163.tar.gz
minetest-2863a3291a5cc9be8eeff063cd187a783e58c163.tar.bz2
minetest-2863a3291a5cc9be8eeff063cd187a783e58c163.zip
Fix flowing liquid animation direction calculation
Diffstat (limited to 'src')
-rw-r--r--src/content_mapblock.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp
index ad819e793..ff8ef5276 100644
--- a/src/content_mapblock.cpp
+++ b/src/content_mapblock.cpp
@@ -492,15 +492,15 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
// -Z towards +Z, thus the direction is +Z.
// Rotate texture to make animation go in flow direction
// Positive if liquid moves towards +Z
- int dz = (corner_levels[side_corners[2][0]] +
- corner_levels[side_corners[2][1]] <
- corner_levels[side_corners[3][0]] +
- corner_levels[side_corners[3][1]]);
+ int dz = (corner_levels[side_corners[3][0]] +
+ corner_levels[side_corners[3][1]]) -
+ (corner_levels[side_corners[2][0]] +
+ corner_levels[side_corners[2][1]]);
// Positive if liquid moves towards +X
- int dx = (corner_levels[side_corners[0][0]] +
- corner_levels[side_corners[0][1]] <
- corner_levels[side_corners[1][0]] +
- corner_levels[side_corners[1][1]]);
+ int dx = (corner_levels[side_corners[1][0]] +
+ corner_levels[side_corners[1][1]]) -
+ (corner_levels[side_corners[0][0]] +
+ corner_levels[side_corners[0][1]]);
// -X
if(-dx >= abs(dz))
{