From 1c90fc6853fd815958e1a4d44b5858f5a4a00560 Mon Sep 17 00:00:00 2001 From: urkerab Date: Sat, 31 Oct 2015 00:50:52 +0000 Subject: [PATCH] Always remove the element when a sprite faints --- js/battle.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/battle.js b/js/battle.js index 433579282..5633aa71b 100644 --- a/js/battle.js +++ b/js/battle.js @@ -1146,6 +1146,11 @@ var Sprite = (function () { opacity: 0 }, 'accel'); this.battle.activityWait(this.elem); + var self = this; + this.elem.promise().done(function() { + self.elem.remove(); + self.elem = null; + }); }; Sprite.prototype.delay = function (time) { this.elem.delay(time);