mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-09-13 03:35:42 -05:00
Fix RandomPlayerAI wrong teamsize assumption (#6216)
This commit is contained in:
committed by
Kirk Scheibelhut
parent
189a1421a8
commit
afffbeb8b0
@@ -99,7 +99,7 @@ export class RandomPlayerAI extends BattlePlayer {
|
||||
|
||||
// Filter out adjacentAlly moves if we have no allies left, unless they're our
|
||||
// only possible move options.
|
||||
const hasAlly = !pokemon[i ^ 1].condition.endsWith(` fnt`);
|
||||
const hasAlly = pokemon.length > 1 && !pokemon[i ^ 1].condition.endsWith(` fnt`);
|
||||
const filtered = canMove.filter(m => m.target !== `adjacentAlly` || hasAlly);
|
||||
canMove = filtered.length ? filtered : canMove;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user