From 16a039697805bccc9937e54e87965979e0a51992 Mon Sep 17 00:00:00 2001 From: Mikko Tiusanen Date: Sun, 30 Nov 2014 23:39:44 +0200 Subject: The myscore command now displays the level based on score only even for admins. --- src/game/g_cmds.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') 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 ) ); } } -- cgit