summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSmallJoker <mk939@ymail.com>2018-04-09 14:58:35 +0200
committerSmallJoker <mk939@ymail.com>2018-04-09 15:06:40 +0200
commitd58801ab3204757e6c49892a05633281144f4f44 (patch)
treecbcd5adeda2d7970323b8859dcb2db0cecd09dd5 /src
parentaf868421da766d11d444c8ead30d5b422507800b (diff)
downloadminetest-d58801ab3204757e6c49892a05633281144f4f44.tar.gz
minetest-d58801ab3204757e6c49892a05633281144f4f44.tar.bz2
minetest-d58801ab3204757e6c49892a05633281144f4f44.zip
upright_sprite: Fix texture position for players
Fixes #6471
Diffstat (limited to 'src')
-rw-r--r--src/content_cao.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index 641093751..4dde1b098 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -516,6 +516,11 @@ void GenericCAO::addToScene(ITextureSource *tsrc)
video::S3DVertex( dx, dy, 0, 0,0,0, c, 0,0),
video::S3DVertex(-dx, dy, 0, 0,0,0, c, 1,0),
};
+ if (m_is_player) {
+ // Move minimal Y position to 0 (feet position)
+ for (video::S3DVertex &vertex : vertices)
+ vertex.Pos.Y += dy;
+ }
u16 indices[] = {0,1,2,2,3,0};
buf->append(vertices, 4, indices, 6);
// Set material
@@ -535,6 +540,11 @@ void GenericCAO::addToScene(ITextureSource *tsrc)
video::S3DVertex(-dx, dy, 0, 0,0,0, c, 0,0),
video::S3DVertex( dx, dy, 0, 0,0,0, c, 1,0),
};
+ if (m_is_player) {
+ // Move minimal Y position to 0 (feet position)
+ for (video::S3DVertex &vertex : vertices)
+ vertex.Pos.Y += dy;
+ }
u16 indices[] = {0,1,2,2,3,0};
buf->append(vertices, 4, indices, 6);
// Set material