summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTony J. White <tjw@tjw.org>2007-02-10 15:59:27 +0000
committerTony J. White <tjw@tjw.org>2007-02-10 15:59:27 +0000
commit7d3cfcf8535ab4ea61e941aaa387ca7b09c6eead (patch)
tree76d705a40cef78165da6ed0f16ae6143ad769d0f /src
parentb3cbb5af2a304acb77aaee3884b461b589098e93 (diff)
* (bug 2989) only let the overmind nag one time about needing spawns if there
are no builders.
Diffstat (limited to 'src')
-rw-r--r--src/game/g_buildable.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 7d02ec15..6a0fde75 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -753,11 +753,34 @@ void AOvermind_Think( gentity_t *self )
}
}
+ // just in case an egg finishes building after we tell overmind to stfu
+ if( level.numAlienSpawns > 0 )
+ self->overmindSpawnsTimer = level.time;
+
//low on spawns
if( level.numAlienSpawns <= 0 && level.time > self->overmindSpawnsTimer )
{
+ qboolean haveBuilder = qfalse;
+ gentity_t *builder;
+
self->overmindSpawnsTimer = level.time + OVERMIND_SPAWNS_PERIOD;
G_BroadcastEvent( EV_OVERMIND_SPAWNS, 0 );
+
+ for( i = 0; i < level.numConnectedClients; i++ )
+ {
+ builder = &g_entities[ level.sortedClients[ i ] ];
+ if( builder->spawned &&
+ ( builder->client->pers.classSelection == PCL_ALIEN_BUILDER0 ||
+ builder->client->pers.classSelection == PCL_ALIEN_BUILDER0_UPG ) )
+ {
+ haveBuilder = qtrue;
+ break;
+ }
+ }
+ // aliens now know they have no eggs, but they're screwed, so stfu
+ if( !haveBuilder )
+ self->overmindSpawnsTimer = level.startTime +
+ ( g_timelimit.integer * 60000 );
}
//overmind dying