From 7fa382d4e9af3403a6805401f53687828743b707 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 20 Feb 2024 18:12:17 +0100 Subject: [PATCH] rename driftgauge cvar and fix nametag rendering bug --- src/d_netcmd.c | 2 +- src/k_kart.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 5947d7b0f..7cb05249c 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -546,7 +546,7 @@ static CV_PossibleValue_t driftgaugeoffset_cons_t[] = { static CV_PossibleValue_t driftgaugestyle_cons_t[] = { {1, "Default"}, {2, "Small"}, {3, "Big Numbers"}, {4, "Numbers Only"}, {0, NULL}}; -consvar_t cv_driftgauge = {"driftgauge", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_driftgauge = {"kartdriftgauge", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_driftgaugeofs = {"driftgaugeoffset", "-20", CV_FLOAT|CV_SAVE, driftgaugeoffset_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_driftgaugetrans = {"driftgaugetransparency", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_driftgaugestyle = {"driftgaugestyle", "1", CV_SAVE, driftgaugestyle_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/k_kart.c b/src/k_kart.c index 17790547d..562410b20 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9063,9 +9063,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; @@ -9112,7 +9109,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;