From 0eb8c8c23d43d940f8bfc0995e428460759b0fd1 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 25 Mar 2015 14:38:22 +1100 Subject: [PATCH] Fix compile --- qcsrc/common/weapons/w_vaporizer.qc | 6 ++---- qcsrc/server/mutators/gamemode_keyhunt.qc | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/qcsrc/common/weapons/w_vaporizer.qc b/qcsrc/common/weapons/w_vaporizer.qc index c757ebd85..edbdfc6e8 100644 --- a/qcsrc/common/weapons/w_vaporizer.qc +++ b/qcsrc/common/weapons/w_vaporizer.qc @@ -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); diff --git a/qcsrc/server/mutators/gamemode_keyhunt.qc b/qcsrc/server/mutators/gamemode_keyhunt.qc index 5935f8c1a..1eb4b407f 100644 --- a/qcsrc/server/mutators/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/gamemode_keyhunt.qc @@ -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); -- 2.39.2