]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
now REALLY stop bullets on weapclip
authorRudolf Polzer <divverent@alientrap.org>
Sat, 4 Dec 2010 19:14:13 +0000 (20:14 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 4 Dec 2010 19:14:13 +0000 (20:14 +0100)
qcsrc/server/w_common.qc

index 3be3be20214716d0d559a085b8c1cbddd23d6167..49e2773836c8cb8397ed883c3670d0affd19db9f 100644 (file)
@@ -451,6 +451,23 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
                                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_NODRAW)
+                       if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID)
+                       if not(trace_dphitcontents & DPCONTENTS_OPAQUE)
+                               break;
+
                        density = other.ballistics_density;
                        if(density == 0)
                                density = 1;