From 9dd501f6338a95183ad4a245c2b813699b3a6513 Mon Sep 17 00:00:00 2001 From: Michael Levin Date: Sat, 3 Oct 2009 11:18:41 +0000 Subject: * Oops, Repeater now gives Repeater reward credits * Reloading a weapon and switching to blaster will not cause it to be "reloaded" * Removed "team change free" flag, all clients keep credits when changing teams * Human and Alien credits properly converted when switching teams (based on max) * Cannot open both say prompts at the same time anymore --- src/game/g_cmds.c | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) (limited to 'src/game/g_cmds.c') diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 6b2e94c2..11dd7973 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -355,7 +355,7 @@ void Cmd_Give_f( gentity_t *ent ) if( give_all || Q_stricmpn( name, "funds", 5 ) == 0 ) { - int credits = give_all ? HUMAN_MAX_CREDITS : atoi( name + 6 ); + int credits = give_all ? ALIEN_MAX_CREDITS : atoi( name + 6 ); G_AddCreditToClient( ent->client, credits, qtrue ); } @@ -565,38 +565,26 @@ G_ChangeTeam void G_ChangeTeam( gentity_t *ent, pTeam_t newTeam ) { pTeam_t oldTeam = ent->client->pers.teamSelection; - + if( oldTeam == newTeam ) return; G_LeaveTeam( ent ); ent->client->pers.teamSelection = newTeam; - - // under certain circumstances, clients can keep their kills and credits - // when switching teams - if( G_admin_permission( ent, ADMF_TEAMCHANGEFREE ) || - ( ( oldTeam == PTE_HUMANS || oldTeam == PTE_ALIENS ) - && ( level.time - ent->client->pers.teamChangeTime ) > 60000 ) ) - { - if( oldTeam == PTE_ALIENS ) - ent->client->pers.credit *= (float)FREEKILL_HUMAN / FREEKILL_ALIEN; - else if( newTeam == PTE_ALIENS ) - ent->client->pers.credit *= (float)FREEKILL_ALIEN / FREEKILL_HUMAN; - } - else - { - ent->client->pers.credit = 0; - ent->client->pers.score = 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 ); + + // Convert between Alien and Human credits, specs use Alien credits + if( oldTeam == PTE_HUMANS ) + ent->client->pers.credit = (int)( ent->client->pers.credit * + ALIEN_MAX_CREDITS / HUMAN_MAX_CREDITS + 0.5f ); + if( newTeam == PTE_HUMANS ) + ent->client->pers.credit = (int)( ent->client->ps.persistant[ PERS_CREDIT ] * + HUMAN_MAX_CREDITS / ALIEN_MAX_CREDITS + 0.5f ); + ent->client->ps.persistant[ PERS_CREDIT ] = ent->client->pers.credit; } /* -- cgit