From 97143eb45a8a29904b97ae8251d8d1d349ebd5c7 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sun, 10 Oct 2004 22:37:08 +0000 Subject: * Heavily revised alien frag sharing * Other assorted changes --- src/game/g_client.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 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 35b68f1a..da2f3d25 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -72,6 +72,32 @@ void SP_info_human_intermission( gentity_t *ent ) { } +/* +=============== +G_AddCreditToClient +=============== +*/ +void G_AddCreditToClient( gclient_t *client, short credit ) +{ + if( !client ) + return; + + client->ps.persistant[ PERS_CREDIT ] += credit; + + if( client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + { + if( client->ps.persistant[ PERS_CREDIT ] > ALIEN_MAX_KILLS ) + client->ps.persistant[ PERS_CREDIT ] = ALIEN_MAX_KILLS; + } + else if( client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + { + if( client->ps.persistant[ PERS_CREDIT ] > HUMAN_MAX_CREDITS ) + client->ps.persistant[ PERS_CREDIT ] = HUMAN_MAX_CREDITS; + } + + if( client->ps.persistant[ PERS_CREDIT ] < 0 ) + client->ps.persistant[ PERS_CREDIT ] = 0; +} /* @@ -1167,10 +1193,10 @@ void ClientBegin( int clientNum ) // send event tent = G_TempEntity( ent->client->ps.origin, EV_PLAYER_TELEPORT_IN ); tent->s.clientNum = ent->s.clientNum; - - trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " entered the game\n\"", client->pers.netname ) ); } + trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " entered the game\n\"", client->pers.netname ) ); + G_LogPrintf( "ClientBegin: %i\n", clientNum ); // count current clients and rank for scoreboard -- cgit