From 6c8c4388491928043fb6e2175616656db12fa754 Mon Sep 17 00:00:00 2001 From: Mikko Tiusanen Date: Thu, 12 Jun 2014 14:52:40 +0300 Subject: No more automatic team balance when humans don't have powered armouries left. --- src/game/g_local.h | 1 + src/game/g_main.c | 4 ++++ src/game/g_team.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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. " -- cgit