Merge pull request #1473 from GriffinRichards/fix-div0

Fix divide by 0 in Cmd_getexp
This commit is contained in:
GriffinR 2021-07-01 14:26:34 -04:00 committed by GitHub
commit 3964820a84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3269,7 +3269,7 @@ static void Cmd_getexp(void)
if (viaExpShare) // at least one mon is getting exp via exp share
{
*exp = calculatedExp / 2 / viaSentIn;
*exp = SAFE_DIV(calculatedExp / 2, viaSentIn);
if (*exp == 0)
*exp = 1;
@ -3279,7 +3279,7 @@ static void Cmd_getexp(void)
}
else
{
*exp = calculatedExp / viaSentIn;
*exp = SAFE_DIV(calculatedExp, viaSentIn);
if (*exp == 0)
*exp = 1;
gExpShareExp = 0;