diff options
Diffstat (limited to 'src/game/g_namelog.c')
-rw-r--r-- | src/game/g_namelog.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/game/g_namelog.c b/src/game/g_namelog.c index 9d9f3b83..af437814 100644 --- a/src/game/g_namelog.c +++ b/src/game/g_namelog.c @@ -59,7 +59,7 @@ void G_namelog_connect( gclient_t *client ) n->slot = client - level.clients; n->banned = qfalse; - newname = n->name[ n->nameChanges % MAX_NAMELOG_NAMES ]; + newname = n->name[ n->nameOffset % MAX_NAMELOG_NAMES ]; // If they're muted, copy in their last known name - this will stop people // reconnecting to get around the name change protection. if( n->muted && G_admin_name_check( &g_entities[ n->slot ], @@ -95,18 +95,18 @@ void G_namelog_update_score( gclient_t *client ) void G_namelog_update_name( gclient_t *client ) { - int i; char n1[ MAX_NAME_LENGTH ], n2[ MAX_NAME_LENGTH ]; namelog_t *n = client->pers.namelog; - G_SanitiseString( client->pers.netname, n1, sizeof( n1 ) ); - for( i = 0; i < MAX_NAMELOG_NAMES && n->name[ i ][ 0 ]; i++ ) + if( n->name[ n->nameOffset % MAX_NAMELOG_NAMES ][ 0 ] ) { - G_SanitiseString( n->name[ i ], n2, sizeof( n2 ) ); - if( !strcmp( n1, n2 ) ) - return; + G_SanitiseString( client->pers.netname, n1, sizeof( n1 ) ); + G_SanitiseString( n->name[ n->nameOffset % MAX_NAMELOG_NAMES ], + n2, sizeof( n2 ) ); + if( strcmp( n1, n2 ) != 0 ) + n->nameOffset++; } - strcpy( n->name[ n->nameChanges % MAX_NAMELOG_NAMES ], client->pers.netname ); + strcpy( n->name[ n->nameOffset % MAX_NAMELOG_NAMES ], client->pers.netname ); } void G_namelog_restore( gclient_t *client ) |