void Ent_DamageEffect()
{
- float type, specnum1, specnum2, isself;
+ float type, specnum1, specnum2, entnumber;
vector org;
string specstr, effectnum;
entity e;
type = ReadByte(); // damage weapon
specnum1 = ReadByte(); // player species
- isself = ReadByte(); // is self
+ entnumber = ReadByte(); // player entnum
org_x = ReadCoord();
org_y = ReadCoord();
org_z = ReadCoord();
return;
if(autocvar_cl_gentle || autocvar_cl_gentle_damage)
return;
+ // if we aren't in third person mode, hide our own damage effect
+ if(entnumber == player_localentnum && !autocvar_chase_active)
+ return;
e = get_weaponinfo(type);
{
// 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), targ == self);
+ Violence_DamageEffect_SetRepeat(targ, damage, DEATH_WEAPONOF(deathtype));
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
+ WriteByte(MSG_ENTITY, self.team); // player entnum
WriteCoord(MSG_ENTITY, floor(self.origin_x));
WriteCoord(MSG_ENTITY, floor(self.origin_y));
WriteCoord(MSG_ENTITY, floor(self.origin_z));
e.classname = "weapondamage";
e.cnt = type;
e.state |= 8 * pl.species; // gib type, ranges from 0 to 15
+ e.team = num_for_edict(pl);
setorigin(e, pl.origin);
Net_LinkEntity(e, FALSE, 0.2, Violence_DamageEffect_SendEntity);
self.nextthink = time + autocvar_sv_damageeffect_tick;
}
-void Violence_DamageEffect_SetRepeat(entity pl, float damage, float type, float isself)
+void Violence_DamageEffect_SetRepeat(entity pl, float damage, float type)
{
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