diff options
author | Tim Angus <tim@ngus.net> | 2004-10-10 22:37:08 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2004-10-10 22:37:08 +0000 |
commit | 97143eb45a8a29904b97ae8251d8d1d349ebd5c7 (patch) | |
tree | c1764cf63534f570c085395cb7c0267e0d76a1ee /src/game/g_client.c | |
parent | 7d66cee2661d2717ff76a4e6f73b75ddeea6d93e (diff) |
* Heavily revised alien frag sharing
* Other assorted changes
Diffstat (limited to 'src/game/g_client.c')
-rw-r--r-- | src/game/g_client.c | 30 |
1 files changed, 28 insertions, 2 deletions
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 |