mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-26 03:28:32 +00:00
Prevent crash with trace
This commit is contained in:
parent
af4e9ff66e
commit
e15b810f6a
@ -1155,6 +1155,8 @@ export class PostSummonFormChangeAbAttr extends PostSummonAbAttr {
|
||||
export class TraceAbAttr extends PostSummonAbAttr {
|
||||
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
|
||||
const targets = pokemon.getOpponents();
|
||||
if (!targets.length)
|
||||
return false;
|
||||
let target: Pokemon;
|
||||
if (targets.length > 1)
|
||||
pokemon.scene.executeWithSeedOffset(() => target = Utils.randSeedItem(targets), pokemon.scene.currentBattle.waveIndex);
|
||||
|
Loading…
x
Reference in New Issue
Block a user