mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Fix flowing liquid animation direction calculation
This commit is contained in:
parent
8adad36a66
commit
2863a3291a
@ -492,15 +492,15 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
|
|||||||
// -Z towards +Z, thus the direction is +Z.
|
// -Z towards +Z, thus the direction is +Z.
|
||||||
// Rotate texture to make animation go in flow direction
|
// Rotate texture to make animation go in flow direction
|
||||||
// Positive if liquid moves towards +Z
|
// Positive if liquid moves towards +Z
|
||||||
int dz = (corner_levels[side_corners[2][0]] +
|
int dz = (corner_levels[side_corners[3][0]] +
|
||||||
corner_levels[side_corners[2][1]] <
|
corner_levels[side_corners[3][1]]) -
|
||||||
corner_levels[side_corners[3][0]] +
|
(corner_levels[side_corners[2][0]] +
|
||||||
corner_levels[side_corners[3][1]]);
|
corner_levels[side_corners[2][1]]);
|
||||||
// Positive if liquid moves towards +X
|
// Positive if liquid moves towards +X
|
||||||
int dx = (corner_levels[side_corners[0][0]] +
|
int dx = (corner_levels[side_corners[1][0]] +
|
||||||
corner_levels[side_corners[0][1]] <
|
corner_levels[side_corners[1][1]]) -
|
||||||
corner_levels[side_corners[1][0]] +
|
(corner_levels[side_corners[0][0]] +
|
||||||
corner_levels[side_corners[1][1]]);
|
corner_levels[side_corners[0][1]]);
|
||||||
// -X
|
// -X
|
||||||
if(-dx >= abs(dz))
|
if(-dx >= abs(dz))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user