mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-24 14:38:33 +01:00
Fix divide by 0 in Cmd_getexp
This commit is contained in:
parent
e0b58592b2
commit
93188ef0a8
@ -3269,7 +3269,7 @@ static void Cmd_getexp(void)
|
|||||||
|
|
||||||
if (viaExpShare) // at least one mon is getting exp via exp share
|
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)
|
if (*exp == 0)
|
||||||
*exp = 1;
|
*exp = 1;
|
||||||
|
|
||||||
@ -3279,7 +3279,7 @@ static void Cmd_getexp(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*exp = calculatedExp / viaSentIn;
|
*exp = SAFE_DIV(calculatedExp, viaSentIn);
|
||||||
if (*exp == 0)
|
if (*exp == 0)
|
||||||
*exp = 1;
|
*exp = 1;
|
||||||
gExpShareExp = 0;
|
gExpShareExp = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user