Fix nametags being shown in first person
This commit is contained in:
parent
8f0dd004f1
commit
b1fa8f8e2b
@ -698,8 +698,6 @@ void Camera::drawNametags()
|
||||
|
||||
for (const Nametag *nametag : m_nametags) {
|
||||
// Nametags are hidden in GenericCAO::updateNametag()
|
||||
if (!nametag->parent_node->isVisible())
|
||||
continue;
|
||||
|
||||
v3f pos = nametag->parent_node->getAbsolutePosition() + nametag->pos * BS;
|
||||
f32 transformed_pos[4] = { pos.X, pos.Y, pos.Z, 1.0f };
|
||||
|
@ -941,7 +941,9 @@ void GenericCAO::updateMarker()
|
||||
|
||||
void GenericCAO::updateNametag()
|
||||
{
|
||||
if (m_prop.nametag.empty() || m_prop.nametag_color.getAlpha() == 0) {
|
||||
if (m_prop.nametag.empty() || m_prop.nametag_color.getAlpha() == 0 ||
|
||||
(m_is_local_player &&
|
||||
m_client->getCamera()->getCameraMode() == CAMERA_MODE_FIRST)) {
|
||||
// Delete nametag
|
||||
if (m_nametag) {
|
||||
m_client->getCamera()->removeNametag(m_nametag);
|
||||
@ -1983,6 +1985,9 @@ void GenericCAO::updateMeshCulling()
|
||||
node->setMaterialFlag(video::EMF_FRONT_FACE_CULLING,
|
||||
false);
|
||||
}
|
||||
|
||||
// Show/hide the nametag
|
||||
updateNametag();
|
||||
}
|
||||
|
||||
// Prototype
|
||||
|
Loading…
x
Reference in New Issue
Block a user