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.
This commit is contained in:
Alex 2024-09-19 10:58:56 +02:00 committed by GitHub
parent 25e9ca2ac6
commit 5cb1be7e5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;