]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix the calculation of the edgedistance for when an edgeoffset is used.
authorSamual <samual@xonotic.org>
Tue, 15 Feb 2011 20:50:29 +0000 (15:50 -0500)
committerSamual <samual@xonotic.org>
Tue, 15 Feb 2011 20:50:29 +0000 (15:50 -0500)
qcsrc/client/waypointsprites.qc

index 6a89f3289309eacf8a90841e859d2a24e3b55756..38390ff2e1c562e07fc2d9fe4cdf1d681d3854bb 100644 (file)
@@ -258,10 +258,10 @@ void Draw_WaypointSprite()
                spriteimage = strcat("models/sprites/", spriteimage, "_frame", ftos(mod(floor((max(0, time - self.spawntime)) * 2), t)));
 
        float edgedistance_min, crosshairdistance;
-       edgedistance_min = min4(o_y, // todo: FIGURE THIS SHIT OUT
-       o_x,
-       vid_conwidth - o_x, 
-       vid_conheight - o_y);
+               edgedistance_min = min4((o_y - (vid_conheight * waypointsprite_edgeoffset_left)), 
+       (o_x - (vid_conwidth * waypointsprite_edgeoffset_top)),
+       (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x, 
+       (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o_y);
 
        crosshairdistance = sqrt( pow(o_x - vid_conwidth/2, 2) + pow(o_y - vid_conheight/2, 2) );