Fixes Gulp Missile freezing the game if when attacker fainted (#6639)

This commit is contained in:
hedara90 2025-04-17 21:32:56 +02:00 committed by GitHub
commit ae95f2c4a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 1 deletions

View File

@ -17993,6 +17993,7 @@ void BS_TryActivateGulpMissile(void)
if (!(gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_NO_EFFECT)
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& IsBattlerAlive(gBattlerAttacker)
&& IsBattlerTurnDamaged(gBattlerTarget)
&& gBattleMons[gBattlerTarget].species != SPECIES_CRAMORANT
&& GetBattlerAbility(gBattlerTarget) == ABILITY_GULP_MISSILE)

View File

@ -6091,7 +6091,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
if (!(gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_NO_EFFECT)
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& IsBattlerTurnDamaged(gBattlerTarget)
&& IsBattlerAlive(battler)
&& IsBattlerAlive(gBattlerAttacker)
&& gBattleMons[gBattlerTarget].species != SPECIES_CRAMORANT)
{
if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)

View File

@ -190,3 +190,13 @@ SINGLE_BATTLE_TEST("(Gulp Missile) Transformed Cramorant Gulping lowers defense
HP_BAR(opponent);
}
}
SINGLE_BATTLE_TEST("Gulp Missile triggered by explosion doesn't freeze the game")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_CRAMORANT);
} WHEN {
TURN { MOVE(opponent, MOVE_SURF); MOVE(player, MOVE_EXPLOSION); }
}
}