summaryrefslogtreecommitdiff
path: root/src/game/g_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r--src/game/g_main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c
index c5670f32..c5546168 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -697,7 +697,15 @@ Return tha length of a spawn queue
*/
int G_GetSpawnQueueLength( spawnQueue_t *sq )
{
- return ( sq->back - sq->front + 1 ) % MAX_CLIENTS;
+ int length = sq->back - sq->front + 1;
+
+ while( length < 0 )
+ length += MAX_CLIENTS;
+
+ while( length >= MAX_CLIENTS )
+ length -= MAX_CLIENTS;
+
+ return length;
}
/*