Skip to content

Commit e9a4f6d

Browse files
author
samme
committed
Stop only the named animation if name is passed
Fixes phaserjs#2299
1 parent d7b6d4e commit e9a4f6d

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

src/animation/AnimationManager.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -308,20 +308,9 @@ Phaser.AnimationManager.prototype = {
308308

309309
if (resetFrame === undefined) { resetFrame = false; }
310310

311-
if (typeof name === 'string')
312-
{
313-
if (this._anims[name])
314-
{
315-
this.currentAnim = this._anims[name];
316-
this.currentAnim.stop(resetFrame);
317-
}
318-
}
319-
else
311+
if (this.currentAnim && (typeof name !== 'string' || name === this.currentAnim.name))
320312
{
321-
if (this.currentAnim)
322-
{
323-
this.currentAnim.stop(resetFrame);
324-
}
313+
this.currentAnim.stop(resetFrame);
325314
}
326315

327316
},

0 commit comments

Comments
 (0)