summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/g_main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 50da23db..88b73c95 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -795,9 +795,12 @@ int G_GetSpawnQueueLength( spawnQueue_t *sq )
{
int length = sq->back - sq->front + 1;
- if( length < 0 )
+ while( length < 0 )
length += MAX_CLIENTS;
+ while( length >= MAX_CLIENTS )
+ length -= MAX_CLIENTS;
+
return length;
}