]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Optimize maths
authorMario <mario@smbclan.net>
Mon, 28 Dec 2015 12:05:50 +0000 (22:05 +1000)
committerMario <mario@smbclan.net>
Mon, 28 Dec 2015 12:05:50 +0000 (22:05 +1000)
qcsrc/client/shownames.qc

index 737535a08804cdd1c25179c14d27b0465891468d..050944dea0d3828ee355f5b2b16b9e0fc828831a 100644 (file)
@@ -58,8 +58,8 @@ void Draw_ShowNames(entity this)
                        vector eo = project_3d_to_2d(it.origin);
                        if (eo.z < 0 || eo.x < 0 || eo.y < 0 || eo.x > vid_conwidth || eo.y > vid_conheight) continue;
                        eo.z = 0;
-                       if (vlen((eX * o.x + eY * o.y) - eo) < autocvar_hud_shownames_antioverlap_distance
-                           && dist > vlen(it.origin - view_origin))
+                       if (vdist(((eX * o.x + eY * o.y) - eo), <, autocvar_hud_shownames_antioverlap_distance)
+                           && vdist((it.origin - view_origin), <, dist))
                        {
                                overlap = true;
                                break;