]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix compile
authorMario <zacjardine@y7mail.com>
Wed, 25 Mar 2015 03:38:22 +0000 (14:38 +1100)
committerMario <zacjardine@y7mail.com>
Wed, 25 Mar 2015 03:38:22 +0000 (14:38 +1100)
qcsrc/common/weapons/w_vaporizer.qc
qcsrc/server/mutators/gamemode_keyhunt.qc

index c757ebd85b01654e9f2d133cda54a73ac6fe7206..edbdfc6e8e3df32d36271339b2648122477e731b 100644 (file)
@@ -385,13 +385,11 @@ void W_Vaporizer_SuperBlast()
                        center = CENTER_OR_VIEWOFS(head);
 
                        // find the closest point on the enemy to the center of the attack
-                       float ang; // angle between shotdir and h
                        float h; // hypotenuse, which is the distance between attacker to head
                        float a; // adjacent side, which is the distance between attacker and the point on w_shotdir that is closest to head.origin
-                       
+
                        h = vlen(center - self.origin);
-                       ang = acos(dotproduct(normalize(center - self.origin), w_shotdir));
-                       a = h * cos(ang);
+                       a = h * (normalize(center - self.origin) * w_shotdir);
 
                        vector nearest_on_line = (w_shotorg + a * w_shotdir);
                        vector nearest_to_attacker = WarpZoneLib_NearestPointOnBox(center + head.mins, center + head.maxs, nearest_on_line);
index 5935f8c1a18bbc17a45f87a79221ca68b111184b..1eb4b407fa4b84184ef071a152602b632b95ec95 100644 (file)
@@ -54,13 +54,11 @@ float kh_CheckPassDirection(vector head_center, vector passer_center, vector pas
                makevectors(passer_angle);
 
                // find the closest point on the enemy to the center of the attack
-               float ang; // angle between shotdir and h
                float h; // hypotenuse, which is the distance between attacker to head
                float a; // adjacent side, which is the distance between attacker and the point on w_shotdir that is closest to head.origin
 
                h = vlen(head_center - passer_center);
-               ang = acos(dotproduct(normalize(head_center - passer_center), v_forward));
-               a = h * cos(ang);
+               a = h * (normalize(head_center - passer_center) * v_forward);
 
                vector nearest_on_line = (passer_center + a * v_forward);
                float distance_from_line = vlen(nearest_to_passer - nearest_on_line);