diff --git a/src/pokemon.c b/src/pokemon.c index cf89c88799..36553aac0c 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5487,11 +5487,14 @@ static s32 GetWildMonTableIdInAlteringCave(u16 species) static inline bool32 CanFirstMonBoostHeldItemRarity(void) { + u32 ability; if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) return FALSE; - else if ((OW_COMPOUND_EYES < GEN_9) && GetMonAbility(&gPlayerParty[0]) == ABILITY_COMPOUND_EYES) + + ability = GetMonAbility(&gPlayerParty[0]); + if ((OW_COMPOUND_EYES < GEN_9) && ability == ABILITY_COMPOUND_EYES) return TRUE; - else if ((OW_SUPER_LUCK == GEN_8) && GetMonAbility(&gPlayerParty[0]) == ABILITY_SUPER_LUCK) + else if ((OW_SUPER_LUCK == GEN_8) && ability == ABILITY_SUPER_LUCK) return TRUE; return FALSE; }