summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/g_buildable.c6
-rw-r--r--src/game/g_client.c6
-rw-r--r--src/game/g_cmds.c16
3 files changed, 27 insertions, 1 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index b3a7e5b4..3219734c 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -833,6 +833,12 @@ void ABooster_Touch( gentity_t *self, gentity_t *other, trace_t *trace )
int ammo, clips, maxClips;
gclient_t *client = other->client;
+ if( !client )
+ return;
+
+ if( client && client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
+ return;
+
//only allow boostage once every 30 seconds
if( client->lastBoostedTime + BOOSTER_INTERVAL > level.time )
return;
diff --git a/src/game/g_client.c b/src/game/g_client.c
index 8e3fdaf1..a4d2684a 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -281,6 +281,9 @@ gentity_t *SelectAlienSpawnPoint( void )
trace_t tr;
float displacement;
+ if( level.numAlienSpawns <= 0 )
+ return NULL;
+
VectorSet( mins, -MAX_ALIEN_BBOX, -MAX_ALIEN_BBOX, -MAX_ALIEN_BBOX );
VectorSet( maxs, MAX_ALIEN_BBOX, MAX_ALIEN_BBOX, MAX_ALIEN_BBOX );
@@ -340,6 +343,9 @@ gentity_t *SelectHumanSpawnPoint( void )
gentity_t *ent;
trace_t tr;
+ if( level.numHumanSpawns <= 0 )
+ return NULL;
+
BG_FindBBoxForClass( PCL_H_BASE, mins, maxs, NULL, NULL, NULL );
count = 0;
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index cca0e673..532de22b 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1048,7 +1048,14 @@ void Cmd_Class_f( gentity_t *ent )
}
else
{
- //spawing from a bioegg
+ //sanity check
+ if( level.numAlienSpawns <= 0 )
+ {
+ trap_SendServerCommand( ent-g_entities, va( "print \"No suitable spawns available\n\"" ) );
+ return;
+ }
+
+ //spawing from an egg
ent->client->pers.pclass = BG_FindClassNumForName( s );
if( ent->client->pers.pclass != PCL_NONE )
@@ -1077,6 +1084,13 @@ void Cmd_Class_f( gentity_t *ent )
}
else if( ent->client->pers.pteam == PTE_HUMANS )
{
+ //sanity check
+ if( level.numHumanSpawns <= 0 )
+ {
+ trap_SendServerCommand( ent-g_entities, va( "print \"No suitable spawns available\n\"" ) );
+ return;
+ }
+
//humans cannot use this command whilst alive
if( ent->client->ps.stats[ STAT_PCLASS ] != PCL_NONE )
{