mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-15 06:15:20 +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
|
||||
.getField(true)
|
||||
.filter(p => p.hasAbilityWithAttr("PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr", false))[0];
|
||||
// Setter may not exist if both NG Pokemon faint simultaneously
|
||||
if (setter == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
applyOnGainAbAttrs({
|
||||
pokemon: setter,
|
||||
passive: setter.getAbility().hasAttr("PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr"),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user