From e9a4f6d3f7f610fab275417fad57044420b71f84 Mon Sep 17 00:00:00 2001 From: samme Date: Sun, 17 Jan 2016 12:34:57 -0800 Subject: [PATCH] Stop only the named animation if `name` is passed Fixes #2299 --- src/animation/AnimationManager.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/animation/AnimationManager.js b/src/animation/AnimationManager.js index 3266b05b3..c802c3197 100644 --- a/src/animation/AnimationManager.js +++ b/src/animation/AnimationManager.js @@ -308,20 +308,9 @@ Phaser.AnimationManager.prototype = { if (resetFrame === undefined) { resetFrame = false; } - if (typeof name === 'string') + if (this.currentAnim && (typeof name !== 'string' || name === this.currentAnim.name)) { - if (this._anims[name]) - { - this.currentAnim = this._anims[name]; - this.currentAnim.stop(resetFrame); - } - } - else - { - if (this.currentAnim) - { - this.currentAnim.stop(resetFrame); - } + this.currentAnim.stop(resetFrame); } },