Merge branch 'fix-leave-div-by-0' into 'next'

Fix stupid divide-by-zero error when leaving servers

See merge request STJr/SRB2!1240
This commit is contained in:
James R 2020-11-09 17:52:19 -05:00
commit 202d2126c9
1 changed files with 8 additions and 4 deletions

View File

@ -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++)
{