diff options
author | Tony J. White <tjw@tjw.org> | 2006-11-13 23:53:01 +0000 |
---|---|---|
committer | Tony J. White <tjw@tjw.org> | 2006-11-13 23:53:01 +0000 |
commit | 60692771589309319ea571ffaabefdd500b5c512 (patch) | |
tree | 340e6e58b81cfa684ced846610f3bbcb59cdf32c /src/game | |
parent | 7897d1d13bc32694316a8c0eb6eec8069263c42d (diff) |
* (bug 2921) don't allow team switch until build timer expires
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/g_cmds.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 56446139..9c1dd05b 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -743,6 +743,20 @@ void Cmd_Team_f( gentity_t *ent ) return; } + //guard against build timer exploit + if( ent->client->pers.teamSelection != PTE_NONE && + ( ent->client->ps.stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0 || + ent->client->ps.stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0_UPG || + BG_InventoryContainsWeapon( WP_HBUILD, ent->client->ps.stats ) || + BG_InventoryContainsWeapon( WP_HBUILD2, ent->client->ps.stats ) ) && + ent->client->ps.stats[ STAT_MISC ] > 0 ) + { + trap_SendServerCommand( ent-g_entities, + va( "print \"You cannot change teams until build timer expires\n\"" ) ); + return; + } + + G_ChangeTeam( ent, team ); if( team == PTE_ALIENS ) |