X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Feffects%2Fqc%2Fdamageeffects.qc;h=17f48136a6c0a4126f1ae96bf172c89fc63b9d4d;hb=5f22a2a699389fbdff74a80d48559f52106999fa;hp=9090977dad3a25a6fa894c00fe8c619905712db6;hpb=797bf448a96c0c13d783c7c919bb2caf6fa16707;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index 9090977da..17f48136a 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -82,8 +82,7 @@ void DamageEffect_Think(entity this) return; // if we aren't using a third person camera, hide our own effects // now generate the particles - vector org; - org = gettaginfo(this, 0); // origin at attached location + vector org = gettaginfo(this, 0); // origin at attached location __pointparticles(this.team, org, '0 0 0', 1); } @@ -108,8 +107,8 @@ void DamageEffect(entity this, vector hitorg, float thedamage, int type, int spe int nearestbone = 0; float life; - string specstr, effectname; - entity e; + string effectname; + entity e, wep; if(!autocvar_cl_damageeffect || autocvar_cl_gentle || autocvar_cl_gentle_damage) return; @@ -149,15 +148,15 @@ 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 = DEATH_WEAPONOF(type).netname; - - if(substring(effectname, strlen(effectname) - 5, 5) == "BLOOD") + 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)) { - specstr = species_prefix(specnum); - specstr = substring(specstr, 0, strlen(specstr) - 1); - effectname = strreplace("BLOOD", specstr, effectname); + string specstr = species_prefix(specnum); + effectname = strcat(specstr, effectname); } else { return; } // objects don't bleed } @@ -175,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; @@ -394,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);