]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Fix world-aligned node rendering at bottom (#10742)
authorWuzzy <wuzzy2@mail.ru>
Fri, 19 Feb 2021 18:45:36 +0000 (18:45 +0000)
committerGitHub <noreply@github.com>
Fri, 19 Feb 2021 18:45:36 +0000 (19:45 +0100)
src/client/mapblock_mesh.cpp

index d78a86b2da75674d49c88869f0308a8b8d185022..167e1e3ec75daa2f0f4eeda5e0cad1008980db7a 100644 (file)
@@ -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;
        }
 }