From 393e5ec89e34f449a28bfd0f31324f10c1a9d0dd Mon Sep 17 00:00:00 2001 From: "M. Kristall" Date: Sat, 3 Oct 2009 11:38:19 +0000 Subject: * (bug 3554) Make sure opened files get closed properly -- for real this time * (bug 3446) Allow the last spawn to be deconstructed when cheats are enabled and g_markDeconstruct is not (Ben Millwood) * (bug 3560) PTRC can be used while the original client is connected * remove unused functions from src/game/g_ptr.c --- src/game/g_client.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/game/g_client.c') diff --git a/src/game/g_client.c b/src/game/g_client.c index d0f9349f..49ae26a9 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -890,9 +890,10 @@ static qboolean G_NonSegModel( const char *filename ) if( len < 0 ) return qfalse; - if( len >= sizeof( text ) - 1 ) + if( len == 0 || len >= sizeof( text ) - 1 ) { - G_Printf( "File %s too long\n", filename ); + trap_FS_FCloseFile( f ); + G_Printf( "File %s is %s\n", filename, len == 0 ? "empty" : "too long" ); return qfalse; } @@ -1676,6 +1677,9 @@ void ClientDisconnect( int clientNum ) tent->s.clientNum = ent->s.clientNum; } + if( ent->client->pers.connection ) + ent->client->pers.connection->clientNum = -1; + G_LogPrintf( "ClientDisconnect: %i [%s] (%s) \"%s\"\n", clientNum, ent->client->pers.ip, ent->client->pers.guid, ent->client->pers.netname ); -- cgit