]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/mirceakitsune/bugfix_impact_effects'
authorRudolf Polzer <divverent@xonotic.org>
Wed, 29 Feb 2012 09:45:00 +0000 (10:45 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 29 Feb 2012 09:45:00 +0000 (10:45 +0100)
1  2 
qcsrc/client/damage.qc

diff --combined qcsrc/client/damage.qc
index 49d392abea2862397e6c49cbdb91ba62dab75c2e,7785ebcbf82b597f06f5e1576b4a84127da7fdfd..fc8b83b5b6c8666a11efe0961ebe8af011cfcbfb
@@@ -113,7 -113,7 +113,7 @@@ void DamageEffect(vector hitorg, float 
  
  void Ent_DamageInfo(float isNew)
  {
-       float dmg, rad, edge, thisdmg, forcemul, species;
+       float dmg, rad, edge, thisdmg, forcemul, species, hitplayer;
        vector force, thisforce;
        entity oldself;
  
        
        for(self = findradius(w_org, rad + MAX_DAMAGEEXTRARADIUS); self; self = self.chain)
        {
 +              // attached ents suck
 +              if(self.tag_entity)
 +                      continue;
 +
                vector nearest = NearestPointOnBox(self, w_org);
                if(rad)
                {
                        self.event_damage(thisdmg, w_deathtype, w_org, thisforce);
  
                DamageEffect(w_org, thisdmg, w_deathtype, species);
+               if(self.isplayermodel)
+                       hitplayer = TRUE; // this impact damaged a player
        }
  
        self = oldself;
        
        // TODO spawn particle effects and sounds based on w_deathtype
        if(!DEATH_ISSPECIAL(w_deathtype))
+       if not(hitplayer && !rad) // don't show ground impacts for hitscan weapons if a player was hit
        {
                float hitwep;