From fae4709f4b56cc881c6f106239c1060ce7f521ff Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Sun, 8 Nov 2020 23:28:20 -0600 Subject: [PATCH] Fix stupid divide-by-zero error --- src/d_clisrv.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index a3fbe88d9..b198011a0 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2501,10 +2501,14 @@ static void CL_RemovePlayer(INT32 playernum, kickreason_t reason) } count--; - spheres = players[playernum].spheres; - rings = players[playernum].rings; - sincrement = spheres/count; - rincrement = rings/count; + sincrement = spheres = players[playernum].spheres; + rincrement = rings = players[playernum].rings; + + if (count) + { + sincrement /= count; + rincrement /= count; + } for (i = 0; i < MAXPLAYERS; i++) {