From 168e4210331dc48c1a2df5307b9265fe7dd3fe0d Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 2 Oct 2025 15:54:46 +0200 Subject: [PATCH] Remove two unused bits from battle structs (#7835) --- include/battle.h | 7 +++---- src/battle_main.c | 1 - src/battle_util.c | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/battle.h b/include/battle.h index dcd680b584..99f5b6ba8e 100644 --- a/include/battle.h +++ b/include/battle.h @@ -149,7 +149,7 @@ struct ProtectStruct u32 chargingTurn:1; u32 fleeType:2; // 0: Normal, 1: FLEE_ITEM, 2: FLEE_ABILITY u32 unableToUseMove:1; // Not to be confused with HITMARKER_UNABLE_TO_USE_MOVE (It is questionable though if there is a difference. Needs further research) - u32 notFirstStrike:1; + u32 laggingTail:1; u32 palaceUnableToUseMove:1; u32 statRaised:1; u32 usedCustapBerry:1; // also quick claw @@ -168,8 +168,7 @@ struct ProtectStruct u16 lashOutAffected:1; u16 assuranceDoubled:1; u16 myceliumMight:1; - u16 laggingTail:1; - u16 padding:9; + u16 padding:10; // End of 16-bit bitfield u16 physicalDmg; u16 specialDmg; @@ -187,10 +186,10 @@ struct SpecialStatus u8 abilityRedirected:1; u8 restoredBattlerSprite: 1; u8 faintedHasReplacement:1; - u8 preventLifeOrbDamage:1; // So that Life Orb doesn't activate various effects. u8 afterYou:1; u8 enduredDamage:1; u8 dancerUsedMove:1; + u8 padding:1; // End of byte u8 switchInAbilityDone:1; u8 switchInItemDone:1; diff --git a/src/battle_main.c b/src/battle_main.c index f7df02731d..f20ae5afaf 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3333,7 +3333,6 @@ const u8* FaintClearSetData(u32 battler) gProtectStructs[battler].confusionSelfDmg = FALSE; gProtectStructs[battler].chargingTurn = FALSE; gProtectStructs[battler].fleeType = 0; - gProtectStructs[battler].notFirstStrike = FALSE; gProtectStructs[battler].statRaised = FALSE; gProtectStructs[battler].pranksterElevated = FALSE; diff --git a/src/battle_util.c b/src/battle_util.c index 2d78576e35..5d9f1e469b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2477,8 +2477,6 @@ static enum MoveCanceller CancellerPPDeduction(struct BattleContext *ctx) ppToDeduct++; } - gProtectStructs[ctx->battlerAtk].notFirstStrike = TRUE; - // For item Metronome, echoed voice if (ctx->currentMove != gLastResultingMoves[ctx->battlerAtk] || WasUnableToUseMove(ctx->battlerAtk)) gBattleStruct->sameMoveTurns[ctx->battlerAtk] = 0;