diff options
author | enneract <trem.redman@gmail.com> | 2014-12-21 15:07:33 +0100 |
---|---|---|
committer | enneract <trem.redman@gmail.com> | 2014-12-21 15:07:33 +0100 |
commit | aa35a605754dedb08cf175f3deb43fcf668c20d6 (patch) | |
tree | e12baddc6752b2c6c2c4c6721c14dd00a17e892f /src/game/g_admin.c | |
parent | 2d3a3188cbd98a3adb4d7dce84f58c59decd488c (diff) | |
parent | ff555a521abe57c7c150d3bd4f1fc65323fbd5dd (diff) |
Merge branch 'combat-stats'
Diffstat (limited to 'src/game/g_admin.c')
-rw-r--r-- | src/game/g_admin.c | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 80dcc49..0677e6f 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -4376,7 +4376,7 @@ G_admin_stats qboolean G_admin_stats( gentity_t *ent ) { gentity_t *targ; - int i, j; + int i; qboolean header = qfalse; char err[ MAX_STRING_CHARS ]; const static char *cswNames[ ] = @@ -4421,41 +4421,29 @@ qboolean G_admin_stats( gentity_t *ent ) { combatRanks_t *ranks = targ->client->pers.combatRanks + i; - for( j = CSD_FIRST; j < CSD_MAX; j++ ) - if( ranks->inuse[ j ] ) - goto no_skip; - continue; - no_skip: + if( !ranks->inuse ) + continue; if( !header ) { header = qtrue; ADMBP( va( "^3stats: ^7combat statistics of %s^7:\n" - "^3%*s ^7 E ^1pct ^7 EB ^1pct ^7 FF ^1pct ^7FBF ^1pct ^7Slf ^1pct^7\n", + "^3%*s %*s %*s^7\n", targ->client->pers.netname, - CSW_MAX_NAME_LEN, "Weapon" ) ); + CSW_MAX_NAME_LEN, "Weapon", + 8, "Skill", + 4, "Rank" ) ); } - ADMBP( va( "^3%*s", CSW_MAX_NAME_LEN, cswNames[ i ] ) ); - - for( j = CSD_FIRST; j < CSD_MAX; j++ ) - { - if( ranks->inuse[ j ] ) - { - ADMBP( va( " ^7%3d", - MIN( (int)round( ranks->effs[ j ] * 100.0f ), 999 ) ) ); - - if( ranks->ranked[ j ] ) - ADMBP( va( " ^1%3d", - (int)round( ranks->effs_pc[ j ] * 100.0f ) ) ); - else - ADMBP( " ^0n/a" ); - } - else - ADMBP( " ^0--- ---" ); - } - - ADMBP( "\n" ); + if( ranks->ranked ) + ADMBP( va( "^3%*s ^7%*d %*d%%\n", + CSW_MAX_NAME_LEN, cswNames[ i ], + 8, (int)round( ranks->skill * 1000 ), + 3, (int)round( ranks->skill_pc * 100 ) ) ); + else + ADMBP( va( "^3%*s ^7%*d ^0----^7\n", + CSW_MAX_NAME_LEN, cswNames[ i ], + 8, (int)round( ranks->skill * 1000 ) ) ); } if( !header ) |