summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikko Tiusanen <ams@daug.net>2014-06-12 14:52:40 +0300
committerMikko Tiusanen <ams@daug.net>2014-06-12 14:52:40 +0300
commit6c8c4388491928043fb6e2175616656db12fa754 (patch)
tree92707864b0c30b9b649f42d891af1b4717587594 /src
parent30c7eca2541d5642dd4a97e8e481686f38a43ea8 (diff)
No more automatic team balance when humans don't have powered armouries left.
Diffstat (limited to 'src')
-rw-r--r--src/game/g_local.h1
-rw-r--r--src/game/g_main.c4
-rw-r--r--src/game/g_team.c2
3 files changed, 6 insertions, 1 deletions
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 183985b..179144c 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -625,6 +625,7 @@ typedef struct
int numAlienSpawns;
int numHumanSpawns;
+ int numHumanArmouries;
int numAlienClients;
int numHumanClients;
diff --git a/src/game/g_main.c b/src/game/g_main.c
index bd3fef0..977ab1e 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -1093,6 +1093,7 @@ void G_CountSpawns( void )
level.numAlienSpawns = 0;
level.numHumanSpawns = 0;
+ level.numHumanArmouries = 0;
for( i = 1, ent = g_entities + i ; i < level.num_entities ; i++, ent++ )
{
if( !ent->inuse || ent->s.eType != ET_BUILDABLE || ent->health <= 0 )
@@ -1103,6 +1104,9 @@ void G_CountSpawns( void )
if( ent->s.modelindex == BA_H_SPAWN )
level.numHumanSpawns++;
+
+ if( ent->powered && ent->s.modelindex == BA_H_ARMOURY )
+ level.numHumanArmouries++;
}
}
diff --git a/src/game/g_team.c b/src/game/g_team.c
index 45a2370..debe11f 100644
--- a/src/game/g_team.c
+++ b/src/game/g_team.c
@@ -542,7 +542,7 @@ void CheckTeamStatus( void )
level.numTeamImbalanceWarnings++;
G_BalanceTeams();
}
- else if( level.numHumanSpawns > 0 &&
+ else if( level.numHumanSpawns > 0 && level.numHumanArmouries > 0 &&
level.numAlienClients - level.numHumanClients >= 2 )
{
trap_SendServerCommand ( -1, "print \"^5Teams are imbalanced. "