Skip to content

Commit

Permalink
Fix pvp subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
versx committed Sep 4, 2020
1 parent 04a5d4e commit 4ed61db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Data/Subscriptions/Models/PvPSubscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public PvPSubscription()
League = PvPLeague.Great;
MinimumRank = 25;
MinimumPercent = 90;
City = "all";
City = null;// "all";
}
}
}
10 changes: 5 additions & 5 deletions src/Data/Subscriptions/SubscriptionProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,14 @@ public async Task ProcessPvPSubscription(PokemonData pkmn)
continue;
}

matchesGreat = pkmn.GreatLeague?.Exists(x => subscribedPokemon.League == PvPLeague.Great &&
(x.CP ?? 0) >= 2400 && (x.CP ?? 0) <= 2500 &&
matchesGreat = pkmn.GreatLeague != null && (pkmn.GreatLeague?.Exists(x => subscribedPokemon.League == PvPLeague.Great &&
(x.CP ?? 0) >= 1400 && (x.CP ?? 0) <= 1500 &&
(x.Rank ?? 4096) <= subscribedPokemon.MinimumRank &&
(x.Percentage ?? 0) >= subscribedPokemon.MinimumPercent) ?? false;
matchesUltra = pkmn.GreatLeague?.Exists(x => subscribedPokemon.League == PvPLeague.Ultra &&
(x.Percentage ?? 0) * 100 >= subscribedPokemon.MinimumPercent) ?? false);
matchesUltra = pkmn.UltraLeague != null && (pkmn.GreatLeague?.Exists(x => subscribedPokemon.League == PvPLeague.Ultra &&
(x.CP ?? 0) >= 2400 && (x.CP ?? 0) <= 2500 &&
(x.Rank ?? 4096) <= subscribedPokemon.MinimumRank &&
(x.Percentage ?? 0) >= subscribedPokemon.MinimumPercent) ?? false;
(x.Percentage ?? 0) * 100 >= subscribedPokemon.MinimumPercent) ?? false);

if (!matchesGreat && !matchesUltra)
continue;
Expand Down

0 comments on commit 4ed61db

Please sign in to comment.