From d4b6af3adb980e24919576c0105d7008b1f6c8c3 Mon Sep 17 00:00:00 2001 From: urkerab Date: Tue, 15 Sep 2015 09:20:44 +0100 Subject: [PATCH] Instant replays should not withdraw --- js/battle.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/js/battle.js b/js/battle.js index a545e1925..45e916bef 100644 --- a/js/battle.js +++ b/js/battle.js @@ -5482,13 +5482,20 @@ var Battle = (function () { break; case 'gametype': this.gameType = args[1]; - if (args[1] === 'doubles') { - if (this.mySide.active.length < 2) this.mySide.active.push(null); - if (this.yourSide.active.length < 2) this.yourSide.active.push(null); - } - if (args[1] === 'triples' || args[1] === 'rotation') { - if (this.mySide.active.length < 3) this.mySide.active.push(null); - if (this.yourSide.active.length < 3) this.yourSide.active.push(null); + switch (args[1]) { + default: + this.mySide.active = [null]; + this.yourSide.active = [null]; + break; + case 'doubles': + this.mySide.active = [null, null]; + this.yourSide.active = [null, null]; + break; + case 'triples': + case 'rotation': + this.mySide.active = [null, null, null]; + this.yourSide.active = [null, null, null]; + break; } break; case 'variation':