Fix bug in StateManager where a state's update function might not get called if it has an empty preload function

This commit is contained in:
TheJare
2013-09-20 22:42:04 +01:00
parent 8452fa0fd4
commit 4b6147d3e3
4 changed files with 11 additions and 39 deletions
+2 -17
View File
@@ -259,13 +259,6 @@ Phaser.StateManager.prototype = {
{
// console.log('Loader queue empty');
this.game.loadComplete();
if (this.onCreateCallback)
{
this.onCreateCallback.call(this.callbackContext);
}
this._created = true;
}
else
{
@@ -278,14 +271,6 @@ Phaser.StateManager.prototype = {
{
// console.log('Preload callback not found');
// No init? Then there was nothing to load either
if (this.onCreateCallback)
{
// console.log('Create callback found');
this.onCreateCallback.call(this.callbackContext);
}
this._created = true;
this.game.loadComplete();
}
@@ -383,9 +368,9 @@ Phaser.StateManager.prototype = {
if (this._created == false && this.onCreateCallback)
{
// console.log('Create callback found');
this._created = true;
this.onCreateCallback.call(this.callbackContext);
}
this._created = true;
},
@@ -455,4 +440,4 @@ Phaser.StateManager.prototype = {
}
};
};