Skip to content

Commit

Permalink
Corrected issue regarding the "Only X" buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMrDew committed Jun 9, 2024
1 parent 2fd7168 commit 9032596
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Pokedex/Pokedex/Controllers/AjaxController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ public TeamRandomizerViewModel GetPokemonTeam(int pokemonCount, List<int> select
}

pokemonTypeDetails = pokemonTypeDetails.GroupBy(x => new { x.PokemonId }).Select(x => x.LastOrDefault()).ToList();
if (selectedLegendaries.Count() < legendaryTypeCount && !onlyLegendaries)
if (selectedLegendaries.Count() < legendaryTypeCount || onlyLegendaries)
{
allPokemon = this.FilterLegendaries(allPokemon, selectedLegendaries, onlyLegendaries);
}
Expand All @@ -606,7 +606,7 @@ public TeamRandomizerViewModel GetPokemonTeam(int pokemonCount, List<int> select
allPokemon = this.FilterEvolutions(allPokemon, selectedEvolutions, selectedGame);
}

if (selectedForms.Count() < 7 && !onlyAltForms)
if (selectedForms.Count() < 7 || onlyAltForms)
{
allPokemon = this.FilterForms(allPokemon, selectedForms, selectedGame, onlyAltForms, multipleMegas, multipleGMax);
}
Expand Down Expand Up @@ -3292,7 +3292,7 @@ private List<Pokemon> FilterForms(List<Pokemon> pokemonList, List<string> formLi
List<PokemonFormDetail> altFormList = this.dataService.GetObjects<PokemonFormDetail>(includes: "AltFormPokemon, AltFormPokemon.Game, OriginalPokemon, OriginalPokemon.Game, Form");
altFormList.ForEach(x => x.AltFormPokemon.Name = string.Concat(x.AltFormPokemon.Name, " (", x.Form.Name, ")"));

if (formList.Count() != 0)
if (formList.Count() != 0 && formList.Count() < 7)
{
List<PokemonFormDetail> altForm = new List<PokemonFormDetail>();
List<Pokemon> allAltForms = new List<Pokemon>();
Expand Down

0 comments on commit 9032596

Please sign in to comment.