diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_servercmds.c | 14 | ||||
-rw-r--r-- | src/game/bg_public.h | 2 | ||||
-rw-r--r-- | src/game/g_cmds.c | 30 |
3 files changed, 14 insertions, 32 deletions
diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index b5a85a5b..949c3adc 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -519,20 +519,6 @@ void CG_Menu( int menu, int arg ) type = DT_COMMAND; break; - case MN_A_TEAMCHANGEBUILDTIMER: - longMsg = "You cannot leave the Alien team until your build timer " - "has expired."; - shortMsg = "You cannot change teams until your build timer expires"; - type = DT_COMMAND; - break; - - case MN_H_TEAMCHANGEBUILDTIMER: - longMsg = "You cannot leave the Human team until your build timer " - "has expired."; - shortMsg = "You cannot change teams until your build timer expires"; - type = DT_COMMAND; - break; - //=============================== // Since cheating commands have no default binds, they will often be done diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 4a343b13..eb6bb8af 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -579,7 +579,6 @@ typedef enum MN_A_NOEROOM, MN_A_TOOCLOSE, MN_A_NOOVMND_EVOLVE, - MN_A_TEAMCHANGEBUILDTIMER, MN_A_EVOLVEBUILDTIMER, MN_A_CANTEVOLVE, MN_A_EVOLVEWALLWALK, @@ -611,7 +610,6 @@ typedef enum MN_H_NOSLOTS, MN_H_NOFUNDS, MN_H_ITEMHELD, - MN_H_TEAMCHANGEBUILDTIMER, MN_H_NOARMOURYHERE, MN_H_NOENERGYAMMOHERE, MN_H_NOROOMBSUITON, diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index bd2a9a38..b4ac5ec2 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -524,7 +524,7 @@ void Cmd_Team_f( gentity_t *ent ) team_t team; team_t oldteam = ent->client->pers.teamSelection; char s[ MAX_TOKEN_CHARS ]; - qboolean force = G_admin_permission(ent, ADMF_FORCETEAMCHANGE); + qboolean force = G_admin_permission( ent, ADMF_FORCETEAMCHANGE ); int aliens = level.numAlienClients; int humans = level.numHumanClients; @@ -534,9 +534,21 @@ void Cmd_Team_f( gentity_t *ent ) humans--; // stop team join spam - if( level.time - ent->client->pers.teamChangeTime < 1000 ) + if( ent->client->pers.teamChangeTime && + level.time - ent->client->pers.teamChangeTime < 1000 ) return; + // stop switching teams for gameplay exploit reasons by enforcing a long + // wait before they can come back + if( !force && ent->client->pers.aliveSeconds && + level.time - ent->client->pers.teamChangeTime < 30000 ) + { + trap_SendServerCommand( ent-g_entities, + va( "print \"You must wait another %d seconds before changing teams again\n\"", + (int) ( ( 30000 - ( level.time - ent->client->pers.teamChangeTime ) ) / 1000.f ) ) ); + return; + } + // disallow joining teams during warmup if( g_doWarmup.integer && ( ( level.warmupTime - level.time ) / 1000 ) > 0 ) { @@ -624,20 +636,6 @@ void Cmd_Team_f( gentity_t *ent ) return; } - // guard against build timer exploit - if( oldteam != TEAM_NONE && ent->client->sess.spectatorState == SPECTATOR_NOT && - ( ent->client->ps.stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0 || - ent->client->ps.stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0_UPG || - BG_InventoryContainsWeapon( WP_HBUILD, ent->client->ps.stats ) ) && - ent->client->ps.stats[ STAT_MISC ] > 0 ) - { - if( ent->client->pers.teamSelection == TEAM_ALIENS ) - G_TriggerMenu( ent->client->ps.clientNum, MN_A_TEAMCHANGEBUILDTIMER ); - else - G_TriggerMenu( ent->client->ps.clientNum, MN_H_TEAMCHANGEBUILDTIMER ); - return; - } - // Apply the change G_ChangeTeam( ent, team ); } |