Skip to content

Commit bc00f92

Browse files
committed
Added a check to avoid calling the function when doing dynamic loading after state is created.
1 parent 1c65c48 commit bc00f92

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/core/StateManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ Phaser.StateManager.prototype = {
589589
loadComplete: function () {
590590

591591
// Make sure to do load-update one last time before state is set to _created
592-
if(this.onLoadUpdateCallback)
592+
if (this._created === false && this.onLoadUpdateCallback)
593593
{
594594
this.onLoadUpdateCallback.call(this.callbackContext, this.game);
595595
}

0 commit comments

Comments
 (0)