From 0fd8a5f77b5b6529fedbdfd00e192b1b1d0440ea Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Wed, 23 May 2012 13:00:31 +0200 Subject: [PATCH] bulletconstant 0 now means only penentrate objects with density -1; bulletconstant -1 doesn't even penetrate these, but works like a regular projectile --- qcsrc/server/w_common.qc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/w_common.qc b/qcsrc/server/w_common.qc index 4a6de5b4b..a2f23956e 100644 --- a/qcsrc/server/w_common.qc +++ b/qcsrc/server/w_common.qc @@ -347,6 +347,12 @@ void W_BallisticBullet_Touch (void) PROJECTILE_TOUCH; W_BallisticBullet_Hit (); + if(self.dmg_radius < 0) // these NEVER penetrate solid + { + remove(self); + return; + } + // if we hit "weapclip", bail out // // rationale of this check: @@ -416,10 +422,12 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f proj.nextthink = time + lifetime; // min(pLifetime, vlen(world.maxs - world.mins) / pSpeed); W_SetupProjectileVelocityEx(proj, dir, v_up, pSpeed, 0, 0, spread, antilagging); proj.angles = vectoangles(proj.velocity); - if(bulletconstant) + if(bulletconstant > 0) proj.dmg_radius = autocvar_g_ballistics_materialconstant / bulletconstant; - else + else if(bulletconstant == 0) proj.dmg_radius = 0; + else + proj.dmg_radius = -1; // so: bulletconstant = bullet mass / area of bullet circle setorigin(proj, start); proj.flags = FL_PROJECTILE; @@ -503,6 +511,9 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f W_BallisticBullet_Hit(); } + if(proj.dmg_radius < 0) // these NEVER penetrate solid + break; + // if we hit "weapclip", bail out // // rationale of this check: -- 2.39.2