+
void W_GiveWeapon (entity e, float wep, string name)
{
entity oldself;
self.W_BallisticBullet_LeaveSolid_origin = trace_endpos;
- dst = vlen(trace_endpos - self.origin);
+ dst = max(cvar("g_ballistics_mindistance"), vlen(trace_endpos - self.origin));
// E(s) = E0 - constant * s, constant = area of bullet circle * material constant / mass
Es_m = E0_m - constant * dst;
if(Es_m <= 0)
void W_BallisticBullet_Touch (void)
{
+ float density;
+
if(self.think == W_BallisticBullet_LeaveSolid_think) // skip this!
return;
PROJECTILE_TOUCH;
W_BallisticBullet_Hit ();
+ density = other.ballistics_density;
+ if(density == 0)
+ density = 1;
+
// go through solid!
- if(!W_BallisticBullet_LeaveSolid(self, self.velocity, self.dmg_radius))
+ if(!W_BallisticBullet_LeaveSolid(self, self.velocity, self.dmg_radius * density))
{
remove(self);
return;
void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float headshotbonus, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
{
- float lag, dt, savetime;
+ float lag, dt, savetime, density;
entity pl, oldself;
entity proj;
W_BallisticBullet_Hit();
}
+ density = other.ballistics_density;
+ if(density == 0)
+ density = 1;
+
// go through solid!
- if(!W_BallisticBullet_LeaveSolid(self, self.velocity, self.dmg_radius))
+ if(!W_BallisticBullet_LeaveSolid(self, self.velocity, self.dmg_radius * density))
break;
W_BallisticBullet_LeaveSolid_think();