aboutsummaryrefslogtreecommitdiff
path: root/src/content_cao.cpp
diff options
context:
space:
mode:
authorTeTpaAka <TeTpaAka@users.noreply.github.com>2017-07-29 19:24:10 +0200
committerSmallJoker <SmallJoker@users.noreply.github.com>2017-07-29 19:24:10 +0200
commitd504831ee2adf59421e82202e350f82701bd3cd0 (patch)
tree60995a1066acd095d386add25362b2a1c660fde8 /src/content_cao.cpp
parent765fd9a0bc0bb9f08d12713dc586e7f4c59c421d (diff)
downloadminetest-d504831ee2adf59421e82202e350f82701bd3cd0.tar.xz
Move the nametag back to the top of the player (#6179)
read the actual height of the collisionbox
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r--src/content_cao.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index 2cc675573..993087353 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -895,8 +895,11 @@ void GenericCAO::addToScene(ITextureSource *tsrc)
scene::ISceneNode *node = getSceneNode();
if (node && m_prop.nametag != "" && !m_is_local_player) {
// Add nametag
+ v3f pos;
+ pos.Y = m_prop.collisionbox.MaxEdge.Y + 0.3f;
m_nametag = m_client->getCamera()->addNametag(node,
- m_prop.nametag, m_prop.nametag_color);
+ m_prop.nametag, m_prop.nametag_color,
+ pos);
}
updateNodePos();
@@ -1700,6 +1703,9 @@ void GenericCAO::processMessage(const std::string &data)
m_prop.nametag_color = readARGB8(is);
if (m_nametag != NULL) {
m_nametag->nametag_color = m_prop.nametag_color;
+ v3f pos;
+ pos.Y = m_prop.collisionbox.MaxEdge.Y + 0.3f;
+ m_nametag->nametag_pos = pos;
}
} else if (cmd == GENERIC_CMD_SPAWN_INFANT) {
u16 child_id = readU16(is);