summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2021-02-19 18:45:36 +0000
committerGitHub <noreply@github.com>2021-02-19 19:45:36 +0100
commite441ab9675238b9530cf6ab1911fa9b5fd4ae13e (patch)
tree203a80f55a728d0c233b735c3a5edf299bbe8e58 /src
parentb2ab5fd1615ac5f907e43992d0905a56cddf798f (diff)
downloadminetest-e441ab9675238b9530cf6ab1911fa9b5fd4ae13e.tar.gz
minetest-e441ab9675238b9530cf6ab1911fa9b5fd4ae13e.tar.bz2
minetest-e441ab9675238b9530cf6ab1911fa9b5fd4ae13e.zip
Fix world-aligned node rendering at bottom (#10742)
Diffstat (limited to 'src')
-rw-r--r--src/client/mapblock_mesh.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/mapblock_mesh.cpp b/src/client/mapblock_mesh.cpp
index d78a86b2d..167e1e3ec 100644
--- a/src/client/mapblock_mesh.cpp
+++ b/src/client/mapblock_mesh.cpp
@@ -404,7 +404,7 @@ static void getNodeVertexDirs(const v3s16 &dir, v3s16 *vertex_dirs)
static void getNodeTextureCoords(v3f base, const v3f &scale, const v3s16 &dir, float *u, float *v)
{
- if (dir.X > 0 || dir.Y > 0 || dir.Z < 0)
+ if (dir.X > 0 || dir.Y != 0 || dir.Z < 0)
base -= scale;
if (dir == v3s16(0,0,1)) {
*u = -base.X - 1;
@@ -422,8 +422,8 @@ static void getNodeTextureCoords(v3f base, const v3f &scale, const v3s16 &dir, f
*u = base.X + 1;
*v = -base.Z - 2;
} else if (dir == v3s16(0,-1,0)) {
- *u = base.X;
- *v = base.Z;
+ *u = base.X + 1;
+ *v = base.Z + 1;
}
}