From 1290a9411d90d777c02fafd9ad53de6fe51798df Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 12 Dec 2022 00:37:00 -0300 Subject: [PATCH] Reorganized SpecialStatus struct to minimize padding. --- include/battle.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/include/battle.h b/include/battle.h index 06e07b341b..658eb12644 100644 --- a/include/battle.h +++ b/include/battle.h @@ -155,6 +155,12 @@ struct ProtectStruct struct SpecialStatus { + s32 dmg; + s32 physicalDmg; + s32 specialDmg; + u8 physicalBattlerId; + u8 specialBattlerId; + u8 changedStatsBattlerId; // Battler that was responsible for the latest stat change. Can be self. u8 statLowered:1; u8 lightningRodRedirected:1; u8 restoredBattlerSprite: 1; @@ -162,33 +168,29 @@ struct SpecialStatus u8 ppNotAffectedByPressure:1; u8 faintedHasReplacement:1; u8 focusBanded:1; - // End of byte u8 focusSashed:1; + // End of byte u8 sturdied:1; u8 stormDrainRedirected:1; u8 switchInAbilityDone:1; u8 switchInItemDone:1; u8 instructedChosenTarget:3; - // End of byte u8 berryReduced:1; + // End of byte + u8 gemParam; + // End of byte u8 gemBoost:1; u8 rototillerAffected:1; // to be affected by rototiller u8 parentalBondState:2; u8 multiHitOn:1; - // End of byte, two bits unused - u8 gemParam; - u8 damagedMons:4; // Mons that have been damaged directly by using a move, includes substitute. - u8 dancerUsedMove:1; - u8 dancerOriginalTarget:3; u8 announceNeutralizingGas:1; // See Cmd_switchineffects u8 neutralizingGasRemoved:1; // See VARIOUS_TRY_END_NEUTRALIZING_GAS u8 affectionEndured:1; - s32 dmg; - s32 physicalDmg; - s32 specialDmg; - u8 physicalBattlerId; - u8 specialBattlerId; - u8 changedStatsBattlerId; // Battler that was responsible for the latest stat change. Can be self. + // End of byte + u8 damagedMons:4; // Mons that have been damaged directly by using a move, includes substitute. + u8 dancerUsedMove:1; + u8 dancerOriginalTarget:3; + // End of byte }; struct SideTimer