Hold Effect and Gastro Acid (on faint) cleanup

This commit is contained in:
PhallenTree 2026-03-21 19:01:00 +00:00 committed by GitHub
parent 0944439191
commit 7b3f3fda8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -3321,10 +3321,8 @@ void FaintClearSetData(enum BattlerId battler)
for (enum Stat i = 0; i < NUM_BATTLE_STATS; i++)
gBattleMons[battler].statStages[i] = DEFAULT_STAT_STAGE;
bool32 keepGastroAcid = gBattleMons[battler].volatiles.gastroAcid;
bool32 keepTransformed = gBattleMons[battler].volatiles.transformed;
memset(&gBattleMons[battler].volatiles, 0, sizeof(struct Volatiles));
gBattleMons[battler].volatiles.gastroAcid = keepGastroAcid; // Edge case: Keep Gastro Acid if pokemon's ability can have effect after fainting, for example Innards Out.
gBattleMons[battler].volatiles.transformed = keepTransformed; // Edge case: Keep Transformed status to prevent triggering FORM_CHANGE_FAINT on transformed mons.
for (enum BattlerId i = 0; i < gBattlersCount; i++)

View File

@ -5695,6 +5695,9 @@ enum HoldEffect GetBattlerHoldEffectInternal(enum BattlerId battler, enum Abilit
enum HoldEffect GetBattlerHoldEffectIgnoreNegation(enum BattlerId battler)
{
if (gBattleStruct->battlerState[battler].notOnField)
return HOLD_EFFECT_NONE;
gPotentialItemEffectBattler = battler;
if (gBattleMons[battler].item == ITEM_ENIGMA_BERRY_E_READER)
return gEnigmaBerries[battler].holdEffect;