From e1cd7b61ed6f57c34ac5336e66a9cde1a9c60e17 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Tue, 16 Jan 2024 13:45:09 -0300 Subject: [PATCH] Small CanFirstMonBoostHeldItemRarity optimization (#4008) --- src/pokemon.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; }