Index: src/game/g_local.h =================================================================== --- src/game/g_local.h (revision 771) +++ src/game/g_local.h (working copy) @@ -333,6 +333,7 @@ weapon_t humanItemSelection; //TA: humans have a starting item pTeam_t teamSelection; //TA: player team (copied to ps.stats[ STAT_PTEAM ]) + int teamChangeTime; //tjw: level.time of last team change qboolean joinedATeam; //TA: used to tell when a PTR code is valid connectionRecord_t *connection; Index: src/game/g_cmds.c =================================================================== --- src/game/g_cmds.c (revision 771) +++ src/game/g_cmds.c (working copy) @@ -465,14 +465,38 @@ else if( oldTeam == PTE_HUMANS ) G_RemoveFromSpawnQueue( &level.humanSpawnQueue, ent->client->ps.clientNum ); - level.bankCredits[ ent->client->ps.clientNum ] = 0; - ent->client->ps.persistant[ PERS_CREDIT ] = 0; - ent->client->ps.persistant[ PERS_SCORE ] = 0; + // tjw: tranfer credits and kills as long as this player has been on the + // same team for at least 5 minutes. this is done to provide + // a penalty for switching teams for reconnaissance. + if( ( oldTeam == PTE_HUMANS || oldTeam == PTE_ALIENS ) + && ( level.time - ent->client->pers.teamChangeTime ) > 300000 ) + { + if( oldTeam == PTE_HUMANS ) + { + ent->client->ps.persistant[ PERS_CREDIT ] *= + (float)FREEKILL_ALIEN / FREEKILL_HUMAN; + } + else if( oldTeam == PTE_ALIENS ) + { + ent->client->ps.persistant[ PERS_CREDIT ] *= + (float)FREEKILL_HUMAN / FREEKILL_ALIEN; + } + } + else + { + ent->client->ps.persistant[ PERS_CREDIT ] = 0; + ent->client->ps.persistant[ PERS_SCORE ] = 0; + } + + // tjw: no longer used + //level.bankCredits[ ent->client->ps.clientNum ] = 0; + ent->client->pers.classSelection = PCL_NONE; ClientSpawn( ent, NULL, NULL, NULL ); } ent->client->pers.joinedATeam = qtrue; + ent->client->pers.teamChangeTime = level.time; //update ClientInfo ClientUserinfoChanged( ent->client->ps.clientNum );