diff --git a/src/gameobjects/components/Animation.js b/src/gameobjects/components/Animation.js index f929a8aca..26ae336c6 100644 --- a/src/gameobjects/components/Animation.js +++ b/src/gameobjects/components/Animation.js @@ -91,8 +91,8 @@ var Animation = new Class({ * A queue of keys of the next Animations to be loaded into this Animation Controller when the current animation completes. * * @name Phaser.GameObjects.Components.Animation#nextAnimsQueue - * @type {Array} - * @default [] + * @type {string[]} + * @since 3.24.0 */ this.nextAnimsQueue = []; @@ -866,7 +866,7 @@ var Animation = new Class({ { var key = this.nextAnim; - this.nextAnim = this.nextAnimsQueue.length > 0 ? this.nextAnimsQueue.shift() : null; + this.nextAnim = (this.nextAnimsQueue.length > 0) ? this.nextAnimsQueue.shift() : null; this.play(key); } @@ -1178,6 +1178,7 @@ var Animation = new Class({ this.animationManager = null; this.parent = null; + this.nextAnimsQueue.length = 0; this.currentAnim = null; this.currentFrame = null;