From 5effd5a8b5a3adce3bff63696218340729ac1352 Mon Sep 17 00:00:00 2001 From: AZero13 Date: Tue, 14 Jan 2025 14:00:48 -0500 Subject: [PATCH] Remove redundant calls to GetMonData in pokemon.c (#5545) Co-authored-by: Rose <83477269+AreaZR@users.noreply.github.com> --- src/pokemon.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 7e38b2e291..eaffcabd39 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4020,12 +4020,8 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov if (dataUnsigned != CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2)) { dataUnsigned += itemEffect[itemEffectParam]; - moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant if (dataUnsigned > CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2)) - { - moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant dataUnsigned = CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2); - } SetMonData(mon, MON_DATA_PP1 + temp2, &dataUnsigned); retVal = FALSE; } @@ -4041,12 +4037,8 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov if (dataUnsigned != CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex)) { dataUnsigned += itemEffect[itemEffectParam++]; - moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant if (dataUnsigned > CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex)) - { - moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant dataUnsigned = CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex); - } SetMonData(mon, MON_DATA_PP1 + moveIndex, &dataUnsigned); retVal = FALSE; }