add SAFE_DIV macro and usages

This commit is contained in:
Kurausukun
2021-07-03 17:18:41 -04:00
parent ee0f35b866
commit ff94d49a45
5 changed files with 14 additions and 12 deletions
+2 -2
View File
@@ -3108,7 +3108,7 @@ static void atk23_getexp(void)
calculatedExp = gBaseStats[gBattleMons[gBattlerFainted].species].expYield * gBattleMons[gBattlerFainted].level / 7;
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;
gExpShareExp = calculatedExp / 2 / viaExpShare;
@@ -3117,7 +3117,7 @@ static void atk23_getexp(void)
}
else
{
*exp = calculatedExp / viaSentIn;
*exp = SAFE_DIV(calculatedExp, viaSentIn);
if (*exp == 0)
*exp = 1;
gExpShareExp = 0;