]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/tracing.qc
Makefile: use `-I.`
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / tracing.qc
index def2477c78bdec65adf6690ef94c2c4f8149eb8a..96062375af35f23a3d59d48ef2c75e7ce68010b9 100644 (file)
@@ -9,12 +9,12 @@
 #include "../g_subs.qh"
 #include "../antilag.qh"
 
-#include "../../common/constants.qh"
-#include "../../common/util.qh"
+#include <common/constants.qh>
+#include <common/util.qh>
 
-#include "../../common/weapons/all.qh"
+#include <common/weapons/all.qh>
 
-#include "../../lib/warpzone/common.qh"
+#include <lib/warpzone/common.qh>
 
 // this function calculates w_shotorg and w_shotdir based on the weapon model
 // offset, trueaim and antilag, and won't put w_shotorg inside a wall.
@@ -277,24 +277,25 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
        // Find all non-hit players the beam passed close by
        if(deathtype == WEP_VAPORIZER.m_id || deathtype == WEP_VORTEX.m_id)
        {
-               FOR_EACH_REALCLIENT(msg_entity)
-               if(msg_entity != self)
-               if(!msg_entity.railgunhit)
-               if(!(IS_SPEC(msg_entity) && msg_entity.enemy == self)) // we use realclient, so spectators can hear the whoosh too
-               {
-                       // nearest point on the beam
-                       beampos = start + dir * bound(0, (msg_entity.origin - start) * dir, length);
+               FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != self, LAMBDA(
+                       if(!it.railgunhit)
+                       if(!(IS_SPEC(it) && it.enemy == self))
+                       {
+                               msg_entity = it;
+                               // nearest point on the beam
+                               beampos = start + dir * bound(0, (msg_entity.origin - start) * dir, length);
 
-                       f = bound(0, 1 - vlen(beampos - msg_entity.origin) / 512, 1);
-                       if(f <= 0)
-                               continue;
+                               f = bound(0, 1 - vlen(beampos - msg_entity.origin) / 512, 1);
+                               if(f <= 0)
+                                       continue;
 
-                       snd = SND(NEXWHOOSH_RANDOM());
+                               snd = SND(NEXWHOOSH_RANDOM());
 
-                       if(!pseudoprojectile)
-                               pseudoprojectile = spawn(); // we need this so the sound uses the "entchannel4" volume
-                       soundtoat(MSG_ONE, pseudoprojectile, beampos, CH_SHOTS, snd, VOL_BASE * f, ATTEN_NONE);
-               }
+                               if(!pseudoprojectile)
+                                       pseudoprojectile = spawn(); // we need this so the sound uses the "entchannel4" volume
+                               soundtoat(MSG_ONE, pseudoprojectile, beampos, CH_SHOTS, snd, VOL_BASE * f, ATTEN_NONE);
+                       }
+               ));
 
                if(pseudoprojectile)
                        remove(pseudoprojectile);