From d24762b5dc751627dc494cc0389e3cf905d849a1 Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Sat, 11 May 2024 15:46:36 +1000 Subject: [PATCH] Fix bug in moveset code (#735) Pokemon with very limited movepools could sometimes generate with no moves --- src/field/pokemon.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 0b4da4c9c..cc2c93d90 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1263,7 +1263,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } } - while (movePool.length > 1 && this.moveset.length < 4) { + while (baseWeights.length > this.moveset.length && this.moveset.length < 4) { if (this.hasTrainer()) { // Sqrt the weight of any damaging moves with overlapping types. This is about a 0.05 - 0.1 multiplier. // Other damaging moves 2x weight if 0-1 damaging moves, 0.5x if 2, 0.125x if 3. These weights double if STAB.