mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-09-30 14:52:36 -05:00
Add better error message for spread move crash
This commit is contained in:
@@ -1395,7 +1395,12 @@ class Battle {
|
||||
targets.push(target.side.missedPokemon);
|
||||
} else {
|
||||
for (const hitTarget of kwArgs.spread.split(',')) {
|
||||
targets.push(this.getPokemon(hitTarget + ': ?')!);
|
||||
const target = this.getPokemon(hitTarget + ': ?');
|
||||
if (!target) {
|
||||
this.log(['error', `Invalid spread move target: "${hitTarget}"`]);
|
||||
continue;
|
||||
}
|
||||
targets.push(target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user