From 5b850f1b493dc0e81cd74e8fe9045a0b52fd511e Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 24 Feb 2024 15:33:50 +0100 Subject: [PATCH] fix nametag rendering bug --- src/k_kart.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index a992b6899..1b083652c 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9059,9 +9059,6 @@ static void K_drawNameTags(void) distance = R_PointToDist(players[i].mo->x, players[i].mo->y); if (distance > maxdistance) continue; - an = R_PointToAngle2(camera[0].x, camera[0].y, players[i].mo->x, players[i].mo->y) - camera[0].angle; - if (an > ANGLE_90 && an < ANGLE_270) - continue; // behind back if (!P_CheckSight(stplyr->mo, players[i].mo)) continue; @@ -9108,7 +9105,11 @@ static void K_drawNameTags(void) dup = vid.dupx; K_GetScreenCoords(&pos, stplyr, camera, players[i].mo->x, players[i].mo->y, players[i].mo->z + players[i].mo->height); - + + //Check for negative screencoords + if (pos.x == -1 || pos.y == -1) + continue; + //Flipcam off if (players[i].mo->eflags & MFE_VERTICALFLIP && !(players[i].pflags & PF_FLIPCAM)) pos.y += players[i].mo->height;