From a7ad0d512e53b6edab9b42734e5fd1244fe72bf3 Mon Sep 17 00:00:00 2001 From: Ivo Julca Date: Fri, 17 Jun 2016 12:36:20 -0500 Subject: [PATCH] Request full team order for duplicate species Otherwise, the opponent can abuse the data shown in Team Preview to discriminate them on switch-in. --- js/client-battle.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/client-battle.js b/js/client-battle.js index 5df570c10..03b4bb9eb 100644 --- a/js/client-battle.js +++ b/js/client-battle.js @@ -591,6 +591,8 @@ } controls += 'How will you start the battle?'; controls += '
'; + + var speciesTable = {}; for (var i = 0; i < switchables.length; i++) { var pokemon = switchables[i]; if (i >= 6) { @@ -598,7 +600,13 @@ } if (toId(pokemon.baseAbility) === 'illusion') { this.choice.count = 6; + break; } + if (speciesTable[pokemon.species]) { + this.choice.count = 6; + break; + } + speciesTable[pokemon.species] = 1; controls += ' '; } if (this.battle.teamPreviewCount) this.choice.count = parseInt(this.battle.teamPreviewCount, 10);