Skip to content

Commit

Permalink
Fix for blank/custom sets breaking stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
anastarawneh committed Sep 12, 2024
1 parent e6bbdea commit 619a8d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/js/game_controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ function predictSwitchOrderEmerald() {
}
}
var partySpecies = partyOrder[window.CURRENT_TRAINER];
if (!partySpecies) {
$(".trainer-poke-switch-list").html("Not available.");
return;
}

var hasDupes = (new Set(partySpecies)).size !== partySpecies.length;
var withMarkedDupes = [];
Expand Down Expand Up @@ -741,6 +745,7 @@ function predictMidTurnSwitchEmerald(p1, p2) {
$(".trainer-poke.right-side").removeClass("switch-risk-mon");
if (slower) {
var partySpecies = partyOrder[window.CURRENT_TRAINER];
if (!partySpecies) return;
var container = ".trainer-poke-list-opposing";
if (flags) {
for (var i in flags["battleType"]["tag"]) {
Expand Down

0 comments on commit 619a8d9

Please sign in to comment.