]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_common.qc
Merge remote branch 'refs/remotes/origin/fruitiex/racefixes'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_common.qc
index 36552e930469f5361372bdc07b5505e99172acfb..0b405ba77e8043dc2d73e7edf7a1155aa8f7554a 100644 (file)
@@ -1,3 +1,4 @@
+
 void W_GiveWeapon (entity e, float wep, string name)
 {
        entity oldself;
@@ -269,7 +270,7 @@ float W_BallisticBullet_LeaveSolid(entity e, vector vel, float constant)
 
        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)
@@ -370,6 +371,8 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
 
        proj.oldvelocity = proj.velocity;
 
+       other = proj; MUTATOR_CALLHOOK(EditProjectile);
+
        if(cvar("g_antilag_bullets"))
        if(pSpeed >= cvar("g_antilag_bullets"))
        {
@@ -510,6 +513,7 @@ void W_PrepareExplosionByDamage(entity attacker, void() explode)
        self.takedamage = DAMAGE_NO;
        self.event_damage = SUB_Null;
        self.owner = attacker;
+       self.realowner = attacker;
 
        // do not explode NOW but in the NEXT FRAME!
        // because recursive calls to RadiusDamage are not allowed