summaryrefslogtreecommitdiff
path: root/src/game/g_cmds.c
diff options
context:
space:
mode:
authorMikko Tiusanen <ams@daug.net>2014-11-30 23:39:44 +0200
committerMikko Tiusanen <ams@daug.net>2014-11-30 23:39:44 +0200
commit16a039697805bccc9937e54e87965979e0a51992 (patch)
treee3da62d8c00158d5450058d1006927c45bc59ca4 /src/game/g_cmds.c
parent67b5fff62082a31e576721e78e6f21cbc1a7bd08 (diff)
The myscore command now displays the level based on score only even for admins.
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r--src/game/g_cmds.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 39a87b9..8595b60 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -3820,19 +3820,18 @@ void G_UnEscapeString( char *in, char *out, int len )
void Cmd_MyScore_f( gentity_t *ent )
{
- g_admin_level_t *n;
+ g_admin_level_t *l,*n;
if ( !ent || !ent->client->pers.admin ) {
ADMP( "This command is only available for registered players.\n" );
return;
}
- if ( n = G_admin_level_next( G_admin_level( ent->client->pers.admin->level ) ) ) {
+ l = G_admin_find_level_for_score( ent->client->pers.admin->score );
+ if ( n = G_admin_level_next( G_admin_level( l->level ) ) ) {
ADMP( va( "^7Level %d (%s^7) total score earned: %d next level: %d\n",
- ent->client->pers.admin->level, G_admin_level( ent->client->pers.admin->level )->name,
- ent->client->pers.admin->score, n->score ) );
+ l->level, G_admin_level( l->level )->name, ent->client->pers.admin->score, n->score ) );
} else {
ADMP( va( "^7Level %d (%s^7) total score earned: %d (max level)\n",
- ent->client->pers.admin->level, G_admin_level( ent->client->pers.admin->level )->name,
- ent->client->pers.admin->score ) );
+ l->level, G_admin_level( l->level )->name, ent->client->pers.admin->score ) );
}
}