mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-20 15:22:19 +02:00
Fix crash when ability is reactivated for a pokemon off the field
This commit is contained in:
parent
6181afc6d2
commit
52da7e1050
@ -1243,7 +1243,7 @@ export class SuppressAbilitiesTag extends ArenaTag {
|
|||||||
if (pokemon) {
|
if (pokemon) {
|
||||||
globalScene.queueMessage(i18next.t("arenaTag:neutralizingGasOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) }));
|
globalScene.queueMessage(i18next.t("arenaTag:neutralizingGasOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) }));
|
||||||
|
|
||||||
for (const fieldPokemon of globalScene.getField()) {
|
for (const fieldPokemon of globalScene.getField(true)) {
|
||||||
if (fieldPokemon && fieldPokemon.id !== pokemon.id) {
|
if (fieldPokemon && fieldPokemon.id !== pokemon.id) {
|
||||||
[ true, false ].forEach((passive) => applyOnLoseAbAttrs(fieldPokemon, passive));
|
[ true, false ].forEach((passive) => applyOnLoseAbAttrs(fieldPokemon, passive));
|
||||||
}
|
}
|
||||||
@ -1274,7 +1274,7 @@ export class SuppressAbilitiesTag extends ArenaTag {
|
|||||||
globalScene.queueMessage(i18next.t("arenaTag:neutralizingGasOnRemove"));
|
globalScene.queueMessage(i18next.t("arenaTag:neutralizingGasOnRemove"));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const pokemon of globalScene.getField()) {
|
for (const pokemon of globalScene.getField(true)) {
|
||||||
// There is only one pokemon with this attr on the field on removal, so its abilities are already active
|
// There is only one pokemon with this attr on the field on removal, so its abilities are already active
|
||||||
if (pokemon && !pokemon.hasAbilityWithAttr(PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr, false)) {
|
if (pokemon && !pokemon.hasAbilityWithAttr(PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr, false)) {
|
||||||
[ true, false ].forEach((passive) => applyOnGainAbAttrs(pokemon, passive));
|
[ true, false ].forEach((passive) => applyOnGainAbAttrs(pokemon, passive));
|
||||||
|
Loading…
Reference in New Issue
Block a user