]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
ballistic projectiles: bail out on weapclip
authorRudolf Polzer <divverent@alientrap.org>
Fri, 19 Nov 2010 21:22:46 +0000 (22:22 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 19 Nov 2010 21:22:46 +0000 (22:22 +0100)
qcsrc/server/extensions.qh
qcsrc/server/w_common.qc

index b72a0500013dc8402a8257d8febd4baef1bd6f75..da45d6d4307125c42ae69e98f97b0b751e22a3f9 100644 (file)
@@ -1813,7 +1813,7 @@ float Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?
 //float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc)
 float Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds
 float Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds
-//float Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
+float Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc)
index 3995a48151e4fe590947ecf993c1b9acdeaa660c..b453918ce3e2bcb426052620edc9e134451f9cd9 100644 (file)
@@ -310,6 +310,26 @@ void W_BallisticBullet_Touch (void)
        PROJECTILE_TOUCH;
        W_BallisticBullet_Hit ();
 
+       // if we hit "weapclip", bail out
+       //
+       // rationale of this check:
+       //
+       // any shader that is solid, nodraw AND trans is meant to clip weapon
+       // shots and players, but has no other effect!
+       //
+       // if it is not trans, it is caulk and should not have this side effect
+       //
+       // matching shaders:
+       //   common/weapclip (intended)
+       //   common/noimpact (is supposed to eat projectiles, but is erased farther above)
+       if(trace_dphitq3surfaceflags
+               &  (Q3SURFACEFLAG_NONSOLID | Q3SURFACEFLAG_NODRAW | Q3SURFACEFLAG_TRANS)
+               == (                         Q3SURFACEFLAG_NODRAW | Q3SURFACEFLAG_TRANS))
+       {
+               remove(self);
+               return;
+       }
+
        density = other.ballistics_density;
        if(density == 0)
                density = 1;