diff options
Diffstat (limited to 'src')
-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 ) |