From 5cb1be7e5cff8a9a7afb349ce6b92175350759cf Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:58:56 +0200 Subject: [PATCH] Minor Gem check optimazation (#5401) Since the variable is only used once I removed it and replaced it with a direct call. Also the if statement is short enough to fit into one line. very ocd induced change but I couldn't look away. --- src/battle_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/battle_main.c b/src/battle_main.c index a4c55ce9b5..78e44956a4 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -6010,9 +6010,7 @@ void SetTypeBeforeUsingMove(u32 move, u32 battler) gBattleStruct->dynamicMoveType = TYPE_ELECTRIC | F_DYNAMIC_TYPE_SET; // Check if a gem should activate. - moveType = GetMoveType(move); - if (holdEffect == HOLD_EFFECT_GEMS - && moveType == ItemId_GetSecondaryId(heldItem)) + if (holdEffect == HOLD_EFFECT_GEMS && GetMoveType(move) == ItemId_GetSecondaryId(heldItem)) { gSpecialStatuses[battler].gemParam = GetBattlerHoldEffectParam(battler); gSpecialStatuses[battler].gemBoost = TRUE;