Added a check to avoid calling the function when doing dynamic loading after state is created.

This commit is contained in:
nexiuhm 2016-01-14 17:23:52 +01:00
parent 1c65c48341
commit bc00f924a7

View file

@ -589,7 +589,7 @@ Phaser.StateManager.prototype = {
loadComplete: function () {
// Make sure to do load-update one last time before state is set to _created
if(this.onLoadUpdateCallback)
if (this._created === false && this.onLoadUpdateCallback)
{
this.onLoadUpdateCallback.call(this.callbackContext, this.game);
}