Skip to content

Commit

Permalink
Gen 7: Fix crashing issue with Limit Pokemon and Force Change evolutions
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-overton committed Mar 18, 2021
1 parent cddeeee commit 0823b70
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4223,7 +4223,11 @@ public void randomizeEvolutions(boolean similarStrength, boolean sameType, boole
for (Evolution ev : pk.evolutionsFrom) {
oldEvoPairs.add(new EvolutionPair(ev.from, ev.to));
if (generationOfPokemon() >= 7 && ev.from.number == 790) { // Special case for Cosmoem to add Lunala/Solgaleo since we remove the split evo
oldEvoPairs.add(new EvolutionPair(ev.from, pokemonPool.get(ev.from.number + (ev.to.number % 791))));
int oppositeVersionLegendaryNumber = ev.to.number == 791 ? 792 : 791;
Pokemon toPkmn = findPokemonInPoolWithSpeciesID(pokemonPool, oppositeVersionLegendaryNumber);
if (toPkmn != null) {
oldEvoPairs.add(new EvolutionPair(ev.from, toPkmn));
}
}
}
}
Expand Down

0 comments on commit 0823b70

Please sign in to comment.