diff options
author | enneract <trem.redman@gmail.com> | 2014-12-20 13:33:55 +0100 |
---|---|---|
committer | enneract <trem.redman@gmail.com> | 2014-12-20 13:33:55 +0100 |
commit | 1cd59c900d16f038f13fb5f392f346cb8c2154a6 (patch) | |
tree | c8837b8082c91ab78ab9280af2db8fd7f8deaab6 /src/game/g_combat.c | |
parent | 3a7015bd646110a378c3b5f0a8638368f2827788 (diff) |
Track self damage in combat statistics.
Diffstat (limited to 'src/game/g_combat.c')
-rw-r--r-- | src/game/g_combat.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/game/g_combat.c b/src/game/g_combat.c index c8090d4..0e8db92 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -1819,7 +1819,9 @@ void G_CombatStats_Hit( gentity_t *ent, gentity_t *hit, combatStatsWeapon_t weap cs = ent->client->pers.combatStats + weapon; - if( hit->s.eType == ET_BUILDABLE ) + if( hit == ent ) + stat = &cs->self; + else if( hit->s.eType == ET_BUILDABLE ) { if( ent->client->pers.teamSelection == hit->buildableTeam ) stat = &cs->friendly_buildable; @@ -1843,7 +1845,8 @@ void G_CombatStats_Hit( gentity_t *ent, gentity_t *hit, combatStatsWeapon_t weap ( stat == &cs->friendly_buildable ) ? "a friendly buildable" : ( stat == &cs->enemy_buildable ) ? "an enemy buildable" : ( stat == &cs->friendly ) ? "a friendly player" : - "an enemy player", + ( stat == &cs->enemy ) ? "an enemy player" : + "themselves", hit - g_entities, cswStrings[ weapon ], damage ); @@ -1871,13 +1874,14 @@ void G_LogCombatStats( gentity_t *ent ) Com_sprintf( p, 4096 - ( p - buffer ), - " %s %i,%i,%i,%i,%i", + " %s %i,%i,%i,%i,%i,%i", cswStrings[ i ], cs->total, cs->enemy, cs->friendly, cs->enemy_buildable, - cs->friendly_buildable ); + cs->friendly_buildable, + cs->self ); while( *p ) p++; } |