From c7546d08c0f0c24990977f9be36830dea07757c5 Mon Sep 17 00:00:00 2001 From: kai Date: Thu, 2 Apr 2020 18:36:00 +0100 Subject: minor listplayers improvements --- src/game/g_admin.c | 8 +++++--- src/game/g_admin.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 6bb44a4..a709838 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -1818,6 +1818,8 @@ qboolean G_admin_readconfig( gentity_t *ent, int skiparg ) qboolean level_open, admin_open, ban_open, command_open; int i; + admin_level_maxname = 0; // reset this or all sorts of weird shit happens + G_admin_cleanup(); if( !g_admin.string[ 0 ] ) @@ -2059,7 +2061,7 @@ qboolean G_admin_readconfig( gentity_t *ent, int skiparg ) // max printable name length for formatting for( i = 0; i < MAX_ADMIN_LEVELS && g_admin_levels[ i ]; i++ ) { - G_DecolorString( l->name, n ); + G_DecolorString( g_admin_levels[ i ]->name, n ); if( strlen( n ) > admin_level_maxname ) admin_level_maxname = strlen( n ); } @@ -5003,7 +5005,7 @@ qboolean G_admin_listplayers( gentity_t *ent, int skiparg ) } if ( G_admin_permission(ent, ADMF_SEESFULLLISTPLAYERS ) ) { - ADMBP( va( "%2i %s%s^7 %-2i %s^7 ^1%1s%1s%1s%1s%1s^7 %s^7 %s%s^7%s\n", + ADMBP( va( "%2i %s%s^7 %-3i %s^7 ^1%1s%1s%1s%1s%1s^7 %s^7 %s%s^7%s\n", i, c, t, @@ -5020,7 +5022,7 @@ qboolean G_admin_listplayers( gentity_t *ent, int skiparg ) ( *n ) ? ")" : "" ) ); } else { - ADMBP( va( "%2i %s%s^7 %-2i %s^7 ^1%1s%1s%1s%1s^7 %s^7 %s%s^7%s\n", + ADMBP( va( "%2i %s%s^7 %-3i %s^7 ^1%1s%1s%1s%1s^7 %s^7 %s%s^7%s\n", i, c, t, diff --git a/src/game/g_admin.h b/src/game/g_admin.h index 9532477..97a1f20 100644 --- a/src/game/g_admin.h +++ b/src/game/g_admin.h @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define ADMBP_begin() G_admin_buffer_begin() #define ADMBP_end() G_admin_buffer_end(ent) -#define MAX_ADMIN_LEVELS 32 +#define MAX_ADMIN_LEVELS 128 #define MAX_ADMIN_ADMINS 1024 #define MAX_ADMIN_BANS 1024 #define MAX_ADMIN_NAMELOGS 128 -- cgit