summaryrefslogtreecommitdiff
path: root/src/game/g_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r--src/game/g_cmds.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 06d2ed81..c12afd4a 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1760,12 +1760,12 @@ void Cmd_Destroy_f( gentity_t *ent )
( ( ent->client->ps.weapon >= WP_ABUILD ) &&
( ent->client->ps.weapon <= WP_HBUILD ) ) )
{
- // Always let the builder prevent the explosion
- if( traceEnt->health <= 0 )
- {
- G_FreeEntity( traceEnt );
- return;
- }
+ // Always let the builder prevent the explosion
+ if( traceEnt->health <= 0 )
+ {
+ G_FreeEntity( traceEnt );
+ return;
+ }
// Cancel deconstruction
if( g_markDeconstruct.integer && traceEnt->deconstruct )
@@ -1781,19 +1781,19 @@ void Cmd_Destroy_f( gentity_t *ent )
traceEnt->s.modelindex == BA_A_SPAWN )
{
if( level.numAlienSpawns <= 1 )
- {
- G_TriggerMenu( ent->client->ps.clientNum, MN_B_LASTSPAWN );
+ {
+ G_TriggerMenu( ent->client->ps.clientNum, MN_B_LASTSPAWN );
return;
- }
+ }
}
else if( ent->client->pers.teamSelection == TEAM_HUMANS &&
traceEnt->s.modelindex == BA_H_SPAWN )
{
if( level.numHumanSpawns <= 1 )
- {
- G_TriggerMenu( ent->client->ps.clientNum, MN_B_LASTSPAWN );
+ {
+ G_TriggerMenu( ent->client->ps.clientNum, MN_B_LASTSPAWN );
return;
- }
+ }
}
}
@@ -1811,10 +1811,13 @@ void Cmd_Destroy_f( gentity_t *ent )
return;
}
- if( g_markDeconstruct.integer )
+ if( traceEnt->health > 0 )
{
if( !deconstruct )
- G_Damage( traceEnt, ent, ent, forward, tr.endpos, ent->health, 0, MOD_SUICIDE );
+ {
+ G_Damage( traceEnt, ent, ent, forward, tr.endpos,
+ traceEnt->health, 0, MOD_SUICIDE );
+ }
else if( g_markDeconstruct.integer )
{
traceEnt->deconstruct = qtrue; // Mark buildable for deconstruction
@@ -3061,6 +3064,13 @@ void ClientCommand( int clientNum )
return;
}
+ if( cmds[ i ].cmdFlags & CMD_CHEAT_TEAM && !g_cheats.integer &&
+ ent->client->pers.teamSelection != TEAM_NONE )
+ {
+ G_TriggerMenu( clientNum, MN_CMD_CHEAT_TEAM );
+ return;
+ }
+
if( cmds[ i ].cmdFlags & CMD_SPEC &&
ent->client->sess.spectatorState == SPECTATOR_NOT )
{