]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/damage.qc
Merge remote branch 'origin/master' into tzork/csqc-items
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / damage.qc
index 34c15837acc26fe3e9cade3ce1430bd218b9da87..fc8b83b5b6c8666a11efe0961ebe8af011cfcbfb 100644 (file)
@@ -113,7 +113,7 @@ void DamageEffect(vector hitorg, float dmg, float type, float specnum)
 
 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;
 
@@ -146,6 +146,10 @@ void Ent_DamageInfo(float isNew)
        
        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)
                {
@@ -188,6 +192,9 @@ void Ent_DamageInfo(float isNew)
                        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;
@@ -325,6 +332,7 @@ void Ent_DamageInfo(float isNew)
        
        // 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;