Skip to content

Commit d58801a

Browse files
committedApr 9, 2018
upright_sprite: Fix texture position for players
Fixes #6471
1 parent af86842 commit d58801a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎src/content_cao.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,11 @@ void GenericCAO::addToScene(ITextureSource *tsrc)
516516
video::S3DVertex( dx, dy, 0, 0,0,0, c, 0,0),
517517
video::S3DVertex(-dx, dy, 0, 0,0,0, c, 1,0),
518518
};
519+
if (m_is_player) {
520+
// Move minimal Y position to 0 (feet position)
521+
for (video::S3DVertex &vertex : vertices)
522+
vertex.Pos.Y += dy;
523+
}
519524
u16 indices[] = {0,1,2,2,3,0};
520525
buf->append(vertices, 4, indices, 6);
521526
// Set material
@@ -535,6 +540,11 @@ void GenericCAO::addToScene(ITextureSource *tsrc)
535540
video::S3DVertex(-dx, dy, 0, 0,0,0, c, 0,0),
536541
video::S3DVertex( dx, dy, 0, 0,0,0, c, 1,0),
537542
};
543+
if (m_is_player) {
544+
// Move minimal Y position to 0 (feet position)
545+
for (video::S3DVertex &vertex : vertices)
546+
vertex.Pos.Y += dy;
547+
}
538548
u16 indices[] = {0,1,2,2,3,0};
539549
buf->append(vertices, 4, indices, 6);
540550
// Set material

0 commit comments

Comments
 (0)