Drag_MoveDrag(oldself, self);
+ Violence_DamageEffect_Copy(oldself, self);
+
+ self.owner = oldself;
self = oldself;
}
self.anim_forwardleft = '20 1 1';
self.anim_backright = '21 1 1';
self.anim_backleft = '22 1 1';
+ self.anim_melee = '23 1 1';
animparseerror = FALSE;
animfilename = strcat(self.model, ".animinfo");
animfile = fopen(animfilename, FILE_READ);
self.anim_forwardleft = animparseline(animfile);
self.anim_backright = animparseline(animfile);
self.anim_backleft = animparseline(animfile);
+ self.anim_melee = animparseline(animfile);
fclose(animfile);
// derived anims
self.dmg_take = self.dmg_take + take;//max(take - 10, 0);
self.dmg_inflictor = inflictor;
- if (self.health <= -150 && self.modelindex != 0)
+ if (self.health <= -autocvar_sv_gibhealth && self.modelindex != 0)
{
// don't use any animations as a gib
self.frame = 0;
Violence_GibSplash(self, 1, 1, attacker);
self.modelindex = 0; // restore later
self.solid = SOLID_NOT; // restore later
+ self.takedamage = DAMAGE_NO; // restore later
}
}
else
self.pushltime = 0;
- float abot, vbot;
+ float abot, vbot, awep;
abot = (clienttype(attacker) == CLIENTTYPE_BOT);
vbot = (clienttype(self) == CLIENTTYPE_BOT);
valid_damage_for_weaponstats = 0;
if(vbot || clienttype(self) == CLIENTTYPE_REAL)
if(abot || clienttype(attacker) == CLIENTTYPE_REAL)
- if(self != attacker)
- if(!DEATH_ISSPECIAL(deathtype))
+ if(attacker && self != attacker)
if(IsDifferentTeam(self, attacker))
+ {
+ if(DEATH_ISSPECIAL(deathtype))
+ awep = attacker.weapon;
+ else
+ awep = DEATH_WEAPONOF(deathtype);
valid_damage_for_weaponstats = 1;
+ }
if(valid_damage_for_weaponstats)
{
dh = dh - max(self.health, 0);
da = da - max(self.armorvalue, 0);
- WeaponStats_LogDamage(DEATH_WEAPONOF(deathtype), abot, self.weapon, vbot, dh + da);
+ WeaponStats_LogDamage(awep, abot, self.weapon, vbot, dh + da);
}
if (self.health < 1)
}
if(valid_damage_for_weaponstats)
- WeaponStats_LogKill(DEATH_WEAPONOF(deathtype), abot, self.weapon, vbot);
+ WeaponStats_LogKill(awep, abot, self.weapon, vbot);
if(sv_gentle < 1) // TODO make a "gentle" version?
if(sound_allowed(MSG_BROADCAST, attacker))
if(sv_gentle > 0 || autocvar_ekg) {
// remove corpse
- PlayerCorpseDamage (inflictor, attacker, 100.0, deathtype, hitloc, force);
+ PlayerCorpseDamage (inflictor, attacker, autocvar_sv_gibhealth+1.0, deathtype, hitloc, force);
}
// reset fields the weapons may use just in case