]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/shownames.qc
Merge branch 'master' into Lyberta/StandaloneOverkillWeapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / shownames.qc
index e46a97cb1d9066d12ef5e53fefdc01a8dc376731..6920a98d197b9ce595298a0d454dd20accdb7839 100644 (file)
@@ -63,7 +63,6 @@ void Draw_ShowNames(entity this)
                        overlap = 0;
        }
 
-       float dist = vlen(this.origin - view_origin);
        if (overlap == -1 && autocvar_hud_shownames_antioverlap)
        {
                // fade tag out if another tag that is closer to you overlaps
@@ -76,7 +75,7 @@ void Draw_ShowNames(entity this)
                        if (eo.z < 0 || eo.x < 0 || eo.y < 0 || eo.x > vid_conwidth || eo.y > vid_conheight) continue;
                        eo.z = 0;
                        if (vdist(((eX * o.x + eY * o.y) - eo), <, autocvar_hud_shownames_antioverlap_distance)
-                           && vdist((it.origin - view_origin), <, dist))
+                           && vlen2(it.origin - view_origin) < vlen2(this.origin - view_origin))
                        {
                                overlap = 1;
                                break;
@@ -117,6 +116,8 @@ void Draw_ShowNames(entity this)
                if (!this.csqcmodel_isdead) a *= f;
        }
        if (a < ALPHA_MIN_VISIBLE && gametype != MAPINFO_TYPE_CTS) return;
+       if (vdist(this.origin - view_origin, >=, max_shot_distance)) return;
+       float dist = vlen(this.origin - view_origin);
        if (autocvar_hud_shownames_maxdistance)
        {
                if (dist >= autocvar_hud_shownames_maxdistance) return;