Merge pull request #2301 from samme/issue-2299

Stop only the named animation if `name` is passed
This commit is contained in:
Richard Davey 2016-02-01 18:12:45 +02:00
commit d6dcd0e5c6

View file

@ -308,21 +308,10 @@ Phaser.AnimationManager.prototype = {
if (resetFrame === undefined) { resetFrame = false; }
if (typeof name === 'string')
{
if (this._anims[name])
{
this.currentAnim = this._anims[name];
this.currentAnim.stop(resetFrame);
}
}
else
{
if (this.currentAnim)
if (this.currentAnim && (typeof name !== 'string' || name === this.currentAnim.name))
{
this.currentAnim.stop(resetFrame);
}
}
},