diff options
author | Tim Angus <tim@ngus.net> | 2006-05-16 21:18:58 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2006-05-16 21:18:58 +0000 |
commit | 7e62e77d7d8a406f8800de980b67c5cb213618de (patch) | |
tree | 3ac49b1f30759aadf87679fd95511e4e92dba63d /src/game/g_cmds.c | |
parent | bac6bec08fe63e12578c47809823cb7ee3016c44 (diff) |
* Patches from bugs:
2677: Credit transfer,
2691: Disallow deconstruct during SD,
2698: nextweap bug on OS X,
2700: Fix to buildables underground bug,
2701: Fix to dretch exploit,
2706: Fix to jetpack uninit memory read
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r-- | src/game/g_cmds.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 6ce2d657..6451c086 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -465,14 +465,35 @@ void G_ChangeTeam( gentity_t *ent, pTeam_t newTeam ) 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; + // Tranfer credits and kills as long as this player has been on the + // same team for at least 1 minute. 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 ) > 60000 ) + { + 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; + } + 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 ); @@ -1437,6 +1458,14 @@ void Cmd_Destroy_f( gentity_t *ent, qboolean deconstruct ) ( ( ent->client->ps.weapon >= WP_ABUILD ) && ( ent->client->ps.weapon <= WP_HBUILD ) ) ) { + // Don't allow destruction of buildables that cannot be rebuilt + if( g_suddenDeathTime.integer && ( level.time - level.startTime >= + g_suddenDeathTime.integer * 60000 ) && + BG_FindBuildPointsForBuildable( traceEnt->s.modelindex ) ) + { + return; + } + if( ent->client->ps.stats[ STAT_MISC ] > 0 ) { G_AddEvent( ent, EV_BUILD_DELAY, ent->client->ps.clientNum ); |