]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
A very trivial optimization
authorterencehill <piuntn@gmail.com>
Sat, 19 Dec 2015 22:27:07 +0000 (23:27 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 19 Dec 2015 22:27:07 +0000 (23:27 +0100)
qcsrc/client/shownames.qc

index 6897dad48823ed4c52e31d83346b72deb22019d2..dcb6a0692ca91624a5346e3c7175d4b05320579f 100644 (file)
@@ -67,9 +67,9 @@ void Draw_ShowNames(entity this)
                ));
        }
        bool onscreen = (o.z >= 0 && o.x >= 0 && o.y >= 0 && o.x <= vid_conwidth && o.y <= vid_conheight);
-       float crosshairdistance = sqrt(pow(o.x - vid_conwidth / 2, 2) + pow(o.y - vid_conheight / 2, 2));
        if (autocvar_hud_shownames_crosshairdistance)
        {
+               float crosshairdistance = sqrt(pow(o.x - vid_conwidth / 2, 2) + pow(o.y - vid_conheight / 2, 2));
                if (autocvar_hud_shownames_crosshairdistance > crosshairdistance) this.pointtime = time;
                if (this.pointtime + autocvar_hud_shownames_crosshairdistance_time <= time) overlap = true;
                else overlap = (autocvar_hud_shownames_crosshairdistance_antioverlap ? overlap : false); // override what antioverlap says unless allowed by cvar.