X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fw_shockwave.qc;h=3f40c5397fcfb8d34b96f4db4e0132c8b07bc5d1;hb=1cc55e217b6a2253d9cd08df599c832773e84ee2;hp=24b8634b91dd1a6b6eb04defa40d2f8f8cecd466;hpb=4dd3c23aa51dd6fe855d8c5d97126a12a372eb3b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/w_shockwave.qc b/qcsrc/common/weapons/w_shockwave.qc index 24b8634b9..3f40c5397 100644 --- a/qcsrc/common/weapons/w_shockwave.qc +++ b/qcsrc/common/weapons/w_shockwave.qc @@ -553,13 +553,11 @@ void W_Shockwave_Attack(void) 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); // WEAPONTODO: replace with simpler method vector nearest_on_line = (w_shotorg + a * w_shotdir);