From: Rudolf Polzer Date: Wed, 23 May 2012 11:00:31 +0000 (+0200) Subject: bulletconstant 0 now means only penentrate objects with density -1; bulletconstant... X-Git-Tag: xonotic-v0.7.0~314^2~4^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0fd8a5f77b5b6529fedbdfd00e192b1b1d0440ea;p=xonotic%2Fxonotic-data.pk3dir.git bulletconstant 0 now means only penentrate objects with density -1; bulletconstant -1 doesn't even penetrate these, but works like a regular projectile --- 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: