Merge pull request #2151 from jaminscript/logic-fix

Remove unnecessary variable
This commit is contained in:
Richard Davey 2016-02-01 19:16:02 +02:00
commit b3da35163a

View file

@ -431,20 +431,15 @@ Phaser.StateManager.prototype = {
if (this.states[key]) if (this.states[key])
{ {
var valid = false;
if (this.states[key]['preload'] || this.states[key]['create'] || this.states[key]['update'] || this.states[key]['render']) if (this.states[key]['preload'] || this.states[key]['create'] || this.states[key]['update'] || this.states[key]['render'])
{ {
valid = true; return true;
} }
else
if (valid === false)
{ {
console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"); console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render");
return false; return false;
} }
return true;
} }
else else
{ {