oran berry doesnt activate when mons is kill

This commit is contained in:
DizzyEggg 2020-07-08 17:22:10 +02:00
parent 52c63cd671
commit fc510a6b44

View File

@ -4199,11 +4199,12 @@ enum
// second argument is 1/X of current hp compared to max hp
static bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId)
{
if (gBattleMons[battlerId].hp == 0)
return FALSE;
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / hpFraction)
{
return TRUE;
}
else if (hpFraction <= 4 && GetBattlerAbility(battlerId) == ABILITY_GLUTTONY && ItemId_GetPocket(itemId) == POCKET_BERRIES
if (hpFraction <= 4 && GetBattlerAbility(battlerId) == ABILITY_GLUTTONY && ItemId_GetPocket(itemId) == POCKET_BERRIES
&& gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / 2)
{
RecordAbilityBattle(battlerId, ABILITY_GLUTTONY);