mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-16 14:55:22 +01:00
[Hotfix] Prevent crash with two NG Pokemon fainting at the same time (#6751)
Prevent crash with two NG Pokemon fainting at the same time
This commit is contained in:
parent
5a8ff3a47f
commit
aea463ab4b
@ -1532,6 +1532,11 @@ export class SuppressAbilitiesTag extends SerializableArenaTag {
|
|||||||
const setter = globalScene
|
const setter = globalScene
|
||||||
.getField(true)
|
.getField(true)
|
||||||
.filter(p => p.hasAbilityWithAttr("PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr", false))[0];
|
.filter(p => p.hasAbilityWithAttr("PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr", false))[0];
|
||||||
|
// Setter may not exist if both NG Pokemon faint simultaneously
|
||||||
|
if (setter == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
applyOnGainAbAttrs({
|
applyOnGainAbAttrs({
|
||||||
pokemon: setter,
|
pokemon: setter,
|
||||||
passive: setter.getAbility().hasAttr("PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr"),
|
passive: setter.getAbility().hasAttr("PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr"),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user