summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2009-10-03 12:16:35 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:48 +0000
commit6c8ce54f94a20e4809368d2788a154c8203ed499 (patch)
treea9f5748812e6c33952b1be34a62ee61ed363e174
parent8d809caefb16b15cb5d5631992dcbc6f1929dce3 (diff)
* Remove another pointless va()
* g_adminNameProtect is now properly disabled when 0 * Do not remove admins with negative levels (if any such levels exist) * Fix admin level name alignment in !listplayers and !listadmins * Fix some !showbans regressions + !showbans -1 was showing the last two bans + !showbans -1 was not working with only 1 ban * Fix a ptr error message
-rw-r--r--src/game/bg_misc.c2
-rw-r--r--src/game/g_admin.c11
-rw-r--r--src/game/g_cmds.c2
3 files changed, 9 insertions, 6 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 27cecf77..002d4111 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -3903,7 +3903,7 @@ int BG_LoadEmoticons( char names[ ][ MAX_EMOTICON_NAME_LEN ], int widths[ ] )
continue;
}
- width = atoi( va( "%c", emoticon[ fileLen - 7 ] ) );
+ width = emoticon[ fileLen - 7 ] - '0';
if( width < 1 || width > 9 )
{
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index c83a7ffe..d6a1ecb5 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -302,7 +302,7 @@ qboolean G_admin_name_check( gentity_t *ent, char *name, char *err, int len )
}
}
- if( !g_adminNameProtect.string[ 0 ] )
+ if( !g_adminNameProtect.integer )
return qtrue;
for( i = 0; i < MAX_ADMIN_ADMINS && g_admin_admins[ i ]; i++ )
@@ -418,7 +418,7 @@ static void admin_writeconfig( void )
for( i = 0; i < MAX_ADMIN_ADMINS && g_admin_admins[ i ]; i++ )
{
// don't write level 0 users
- if( g_admin_admins[ i ]->level < 1 )
+ if( g_admin_admins[ i ]->level == 0 )
continue;
trap_FS_Write( "[admin]\n", 8, f );
@@ -564,6 +564,7 @@ static void admin_default_levels( void )
Q_strncpyz( g_admin_levels[ 5 ]->name, "^1Server Operator",
sizeof( l->name ) );
Q_strncpyz( g_admin_levels[ 5 ]->flags, "*", sizeof( l->flags ) );
+ admin_level_maxname = 15;
}
// return a level for a player entity.
@@ -1092,6 +1093,8 @@ qboolean G_admin_readconfig( gentity_t *ent, int skiparg )
*( cnf + len ) = '\0';
trap_FS_FCloseFile( f );
+ admin_level_maxname = 0;
+
level_open = admin_open = ban_open = command_open = qfalse;
COM_BeginParseSession( g_admin.string );
while( 1 )
@@ -2429,14 +2432,14 @@ qboolean G_admin_showbans( gentity_t *ent, int skiparg )
start--;
else if( start < 0 )
{
- for( i = max, count = 0; i > 0 && count < -start; i-- )
+ for( i = max, count = 0; i >= 0 && count < -start; i-- )
{
if( g_admin_bans[ i ]->expires == 0 ||
( g_admin_bans[ i ]->expires - t ) > 0 )
count++;
}
- start = i;
+ start = i + 1;
}
}
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index c12afd4a..c9bbf465 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -2790,7 +2790,7 @@ void Cmd_PTRCRestore_f( gentity_t *ent )
else
{
trap_SendServerCommand( ent - g_entities,
- va( "print \"\"%d\" is not a valid PTR code\n\"", code ) );
+ va( "print \"'%d' is not a valid PTR code\n\"", code ) );
}
}