summaryrefslogtreecommitdiff
path: root/src/game/g_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_client.c')
-rw-r--r--src/game/g_client.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/game/g_client.c b/src/game/g_client.c
index eefc266b..6320df2f 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -990,10 +990,6 @@ void ClientUserinfoChanged( int clientNum )
if( strcmp( oldname, newname ) )
{
- // in case we need to revert and there's no oldname
- if( client->pers.connected != CON_CONNECTED )
- Q_strncpyz( oldname, "UnnamedPlayer", sizeof( oldname ) );
-
if( client->pers.nameChangeTime &&
( level.time - client->pers.nameChangeTime )
<= ( g_minNameChangePeriod.value * 1000 ) )
@@ -1019,7 +1015,7 @@ void ClientUserinfoChanged( int clientNum )
if( revertName )
{
- Q_strncpyz( client->pers.netname, oldname,
+ Q_strncpyz( client->pers.netname, *oldname ? oldname : "UnnamedPlayer",
sizeof( client->pers.netname ) );
Info_SetValueForKey( userinfo, "name", oldname );
trap_SetUserinfo( clientNum, userinfo );
@@ -1039,13 +1035,13 @@ void ClientUserinfoChanged( int clientNum )
if( client->sess.spectatorState == SPECTATOR_SCOREBOARD )
Q_strncpyz( client->pers.netname, "scoreboard", sizeof( client->pers.netname ) );
- if( client->pers.connected == CON_CONNECTED )
+ if( *oldname )
{
if( strcmp( oldname, client->pers.netname ) )
{
trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE
" renamed to %s" S_COLOR_WHITE "\n\"", oldname, client->pers.netname ) );
- G_LogPrintf( "ClientRename: %i [%s] (%s) \"%s\" -> \"%s\"\n", clientNum,
+ G_LogPrintf( "ClientRename: %i [%s] (%s) \"%s^7\" -> \"%s^7\"\n", clientNum,
client->pers.ip, client->pers.guid, oldname, client->pers.netname );
G_admin_namelog_update( client, qfalse );
}
@@ -1055,9 +1051,6 @@ void ClientUserinfoChanged( int clientNum )
health = atoi( Info_ValueForKey( userinfo, "handicap" ) );
client->pers.maxHealth = health;
- if( client->pers.maxHealth < 1 || client->pers.maxHealth > 100 )
- client->pers.maxHealth = 100;
-
if( client->pers.classSelection == PCL_NONE )
{
//This looks hacky and frankly it is. The clientInfo string needs to hold different
@@ -1231,7 +1224,7 @@ char *ClientConnect( int clientNum, qboolean firstTime )
// get and distribute relevent paramters
ClientUserinfoChanged( clientNum );
- G_LogPrintf( "ClientConnect: %i [%s] (%s) \"%s\"\n", clientNum,
+ G_LogPrintf( "ClientConnect: %i [%s] (%s) \"%s^7\"\n", clientNum,
client->pers.ip, client->pers.guid, client->pers.netname );
// don't do the "xxx connected" messages if they were caried over from previous level
@@ -1667,7 +1660,7 @@ void ClientDisconnect( int clientNum )
if( ent->client->pers.connection )
ent->client->pers.connection->clientNum = -1;
- G_LogPrintf( "ClientDisconnect: %i [%s] (%s) \"%s\"\n", clientNum,
+ G_LogPrintf( "ClientDisconnect: %i [%s] (%s) \"%s^7\"\n", clientNum,
ent->client->pers.ip, ent->client->pers.guid, ent->client->pers.netname );
trap_UnlinkEntity( ent );