void Ent_DamageEffect()
{
- float type, specnum1, specnum2;
+ float type, specnum1, specnum2, isself;
vector org;
string specstr, effectnum;
entity e;
type = ReadByte(); // damage weapon
specnum1 = ReadByte(); // player species
+ isself = ReadByte(); // is self
org_x = ReadCoord();
org_y = ReadCoord();
org_z = ReadCoord();
{
// if the target is a player or dead body, activate damage effects
if(targ.classname == "player" || targ.classname == "body")
- Violence_DamageEffect_SetRepeat(targ, damage, DEATH_WEAPONOF(deathtype));
+ Violence_DamageEffect_SetRepeat(targ, damage, DEATH_WEAPONOF(deathtype), targ == self);
float mirrordamage;
float mirrorforce;
WriteByte(MSG_ENTITY, ENT_CLIENT_DAMAGEEFFECT);
WriteByte(MSG_ENTITY, self.cnt); // the damage weapon
WriteByte(MSG_ENTITY, self.state); // species
+ WriteByte(MSG_ENTITY, self.team); // is self
WriteCoord(MSG_ENTITY, floor(self.origin_x));
WriteCoord(MSG_ENTITY, floor(self.origin_y));
WriteCoord(MSG_ENTITY, floor(self.origin_z));
self.nextthink = time + autocvar_sv_damageeffect_tick;
}
-void Violence_DamageEffect_SetRepeat(entity pl, float damage, float type)
+void Violence_DamageEffect_SetRepeat(entity pl, float damage, float type, float isself)
{
if not(autocvar_sv_damageeffect_tick && autocvar_sv_damageeffect_lifetime)
return;
pl.damageeffect_repeater.owner = pl;
pl.damageeffect_repeater.think = Violence_DamageEffect_DoRepeat;
+ pl.damageeffect_repeater.team = isself;
pl.damageeffect_repeater.lifetime = time + (autocvar_sv_damageeffect_lifetime * damage);
}
else