]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/effects/qc/damageeffects.qc
Merge branch 'master' into Mario/stats_eloranking
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / effects / qc / damageeffects.qc
index cc487a552a26e4180f175da845f085615fb9e498..17f48136a6c0a4126f1ae96bf172c89fc63b9d4d 100644 (file)
@@ -108,7 +108,7 @@ void DamageEffect(entity this, vector hitorg, float thedamage, int type, int spe
        int nearestbone = 0;
        float life;
        string effectname;
-       entity e;
+       entity e, wep;
 
        if(!autocvar_cl_damageeffect || autocvar_cl_gentle || autocvar_cl_gentle_damage)
                return;
@@ -148,9 +148,11 @@ void DamageEffect(entity this, vector hitorg, float thedamage, int type, int spe
 
        life = bound(autocvar_cl_damageeffect_lifetime_min, thedamage * autocvar_cl_damageeffect_lifetime, autocvar_cl_damageeffect_lifetime_max);
 
-       effectname = strcat("damage_", DEATH_WEAPONOF(type).netname);
-       if(DEATH_WEAPONOF(type) == WEP_SHOTGUN || DEATH_WEAPONOF(type) == WEP_MACHINEGUN)
+       wep = DEATH_WEAPONOF(type);
+       effectname = strcat("damage_", wep.netname);
+       if((wep.spawnflags & WEP_FLAG_BLEED))
        {
+               // if this weapon induces bleeding, use the effect name with the proper species prefix (blood type)
                if((this.isplayermodel & ISPLAYER_MODEL))
                {
                        string specstr = species_prefix(specnum);
@@ -172,7 +174,6 @@ void DamageEffect(entity this, vector hitorg, float thedamage, int type, int spe
 
 NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
 {
-       const float ATTEN_LOW = 0.2;
        float thedamage, rad, edge, thisdmg;
        bool hitplayer = false;
        int species, forcemul;
@@ -391,7 +392,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
                w_random = prandom();
 
                traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, NULL);
-               if(trace_fraction < 1 && hitwep != WEP_VORTEX && hitwep != WEP_VAPORIZER)
+               if(trace_fraction < 1 && !(hitwep.spawnflags & WEP_TYPE_HITSCAN))
                        w_backoff = trace_plane_normal;
                else
                        w_backoff = -1 * normalize(force);