summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/g_cmds.c45
-rw-r--r--src/game/g_main.c4
2 files changed, 25 insertions, 24 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 6315ca2e..2265aaa9 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1671,6 +1671,7 @@ void Cmd_Destroy_f( gentity_t *ent )
gentity_t *traceEnt;
char cmd[ 12 ];
qboolean deconstruct = qtrue;
+ qboolean lastSpawn = qfalse;
if( ent->client->pers.denyBuild )
{
@@ -1705,7 +1706,7 @@ void Cmd_Destroy_f( gentity_t *ent )
return;
}
- // Cancel deconstruction
+ // Cancel deconstruction (unmark)
if( deconstruct && g_markDeconstruct.integer && traceEnt->deconstruct )
{
traceEnt->deconstruct = qfalse;
@@ -1713,27 +1714,24 @@ void Cmd_Destroy_f( gentity_t *ent )
}
// Prevent destruction of the last spawn
- if( !g_cheats.integer &&
- ( !g_markDeconstruct.integer || !G_FindPower( traceEnt ) ) )
+ if( ent->client->pers.teamSelection == TEAM_ALIENS &&
+ traceEnt->s.modelindex == BA_A_SPAWN )
{
- if( ent->client->pers.teamSelection == TEAM_ALIENS &&
- traceEnt->s.modelindex == BA_A_SPAWN )
- {
- if( level.numAlienSpawns <= 1 )
- {
- 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 );
- return;
- }
- }
+ if( level.numAlienSpawns <= 1 )
+ lastSpawn = qtrue;
+ }
+ else if( ent->client->pers.teamSelection == TEAM_HUMANS &&
+ traceEnt->s.modelindex == BA_H_SPAWN )
+ {
+ if( level.numHumanSpawns <= 1 )
+ lastSpawn = qtrue;
+ }
+
+ if( lastSpawn && !g_cheats.integer &&
+ !g_markDeconstruct.integer )
+ {
+ G_TriggerMenu( ent->client->ps.clientNum, MN_B_LASTSPAWN );
+ return;
}
// Don't allow destruction of hovel with granger inside
@@ -1742,7 +1740,10 @@ void Cmd_Destroy_f( gentity_t *ent )
// Don't allow destruction of buildables that cannot be rebuilt
if( G_TimeTilSuddenDeath( ) <= 0 )
+ {
+ G_TriggerMenu( ent->client->ps.clientNum, MN_B_SUDDENDEATH );
return;
+ }
if( !g_markDeconstruct.integer ||
( ent->client->pers.teamSelection == TEAM_HUMANS &&
@@ -1764,7 +1765,7 @@ void Cmd_Destroy_f( gentity_t *ent )
}
else if( g_markDeconstruct.integer &&
( ent->client->pers.teamSelection != TEAM_HUMANS ||
- G_FindPower( traceEnt ) ) )
+ G_FindPower( traceEnt ) || lastSpawn ) )
{
traceEnt->deconstruct = qtrue; // Mark buildable for deconstruction
traceEnt->deconstructTime = level.time;
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 2fa41c1d..141404ad 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -225,7 +225,7 @@ static cvarTable_t gameCvarTable[ ] =
{ &g_alienStage3Threshold, "g_alienStage3Threshold", DEFAULT_ALIEN_STAGE3_THRESH, 0, 0, qfalse },
{ &g_freeFundPeriod, "g_freeFundPeriod", DEFAULT_FREEKILL_PERIOD, CVAR_ARCHIVE, 0, qtrue },
- { &g_unlagged, "g_unlagged", "1", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qfalse },
+ { &g_unlagged, "g_unlagged", "1", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qtrue },
{ &g_disabledEquipment, "g_disabledEquipment", "", CVAR_ROM, 0, qfalse },
{ &g_disabledClasses, "g_disabledClasses", "", CVAR_ROM, 0, qfalse },
@@ -236,7 +236,7 @@ static cvarTable_t gameCvarTable[ ] =
{ &g_floodMaxDemerits, "g_floodMaxDemerits", "5000", CVAR_ARCHIVE, 0, qfalse },
{ &g_floodMinTime, "g_floodMinTime", "2000", CVAR_ARCHIVE, 0, qfalse },
- { &g_markDeconstruct, "g_markDeconstruct", "3", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qfalse },
+ { &g_markDeconstruct, "g_markDeconstruct", "3", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qtrue },
{ &g_debugMapRotation, "g_debugMapRotation", "0", 0, 0, qfalse },
{ &g_currentMapRotation, "g_currentMapRotation", "-1", 0, 0, qfalse }, // -1 = NOT_ROTATING