Add Grip Claw item and fix evolution logic bug

This commit is contained in:
Flashfyre committed 2023-05-05 16:55:46 -04:00
1 parent f33ee493bd
commit d53959e0a9
5 files changed
+100 -35

No files matched your search

+2 -5
View File
@@ -267,11 +267,8 @@ export default class PokemonSpecies extends PokemonSpeciesForm {
if (noEvolutionChance === 1 || Math.random() < noEvolutionChance)
return this.speciesId;
if (evolutionPool.size === 1)
return evolutionPool.values()[0];
const randValue = Math.random() * totalWeight;
const randValue = evolutionPool.size === 1 ? 0 : Math.random() * totalWeight;
for (let weight of evolutionPool.keys()) {
if (randValue < weight)