From cc4724e26477bcd66b72dfdf648416c676ab4ded Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Sun, 24 Jan 2016 01:49:26 -0500 Subject: [PATCH] Battles: Improve fast-forward performance This specifically affects turn skipping, skipping to the end of a battle, joining a battle in the middle, and skipping to a specific turn or skipping backwards in replays. --- js/battle.js | 189 +++++++++++++++++++++++++++++---------------------- 1 file changed, 108 insertions(+), 81 deletions(-) diff --git a/js/battle.js b/js/battle.js index 953757594..3f2cbcdf3 100644 --- a/js/battle.js +++ b/js/battle.js @@ -412,7 +412,7 @@ var Pokemon = (function () { volatile = toId(volatile); var battle = this.side.battle; if (this.hasTurnstatus(volatile)) { - if (volatile === 'protect' || volatile === 'magiccoat') { + if ((volatile === 'protect' || volatile === 'magiccoat') && !battle.fastForward) { this.turnstatuses[volatile][1].css(battle.pos({ x: this.sprite.x, y: this.sprite.y, @@ -435,24 +435,36 @@ var Pokemon = (function () { if (volatile === 'protect' || volatile === 'magiccoat') { this.side.battle.spriteElemsFront[this.side.n].append('