// These are ALWAYS lethal
// No damage modification here
// Instead, prepare the victim for his death...
- SetResourceExplicit(targ, RES_ARMOR, 0);
+ if(deathtype == DEATH_TEAMCHANGE.m_id || deathtype == DEATH_AUTOTEAMCHANGE.m_id)
+ {
+ SetResourceExplicit(targ, RES_ARMOR, 0);
+ SetResourceExplicit(targ, RES_HEALTH, 0.9); // this is < 1
+ }
targ.spawnshieldtime = 0;
- SetResourceExplicit(targ, RES_HEALTH, 0.9); // this is < 1
targ.flags -= targ.flags & FL_GODMODE;
damage = 100000;
}
}
float realdmg = damage - excess;
- if (this != attacker && realdmg && !STAT(FROZEN, this)
+ if ((this != attacker || deathtype == DEATH_KILL.m_id) && realdmg && !STAT(FROZEN, this)
&& (!(round_handler_IsActive() && !round_handler_IsRoundStarted()) && time >= game_starttime))
{
- if (IS_PLAYER(attacker) && DIFF_TEAM(attacker, this)) {
+ if (IS_PLAYER(attacker) && DIFF_TEAM(attacker, this) && deathtype != DEATH_KILL.m_id) {
GameRules_scoring_add(attacker, DMG, realdmg);
}
+ // don't count DEATH_KILL damage in game modes where suicide is for respawning
+ // TODO mutator hook?
+ if (deathtype != DEATH_KILL.m_id || !(IS_GAMETYPE(RACE) || IS_GAMETYPE(CTS)))
if (IS_PLAYER(this)) {
GameRules_scoring_add(this, DMGTAKEN, realdmg);
}