Skip to content

Commit

Permalink
Minor Gem check optimazation (#5401)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AlexOn1ine authored Sep 19, 2024
1 parent 25e9ca2 commit 5cb1be7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5cb1be7

Please sign in to comment.