Bug in implementation of #35, failed to skip ourselves

This commit is contained in:
2014-07-05 12:43:58 -07:00
parent 0572550d38
commit 914536670a

View File

@@ -347,7 +347,7 @@ var AISprite = function(game, x, y, key, frame) {
var aiSprites = game.state.states.game.aiSprites; var aiSprites = game.state.states.game.aiSprites;
var hasBeenReset = false; var hasBeenReset = false;
aiSprites.forEach(function(spr) { aiSprites.forEach(function(spr) {
if ( hasBeenReset == true ) if ( hasBeenReset == true || spr == this)
return; return;
if ( game.physics.arcade.overlap(spr, this) ) { if ( game.physics.arcade.overlap(spr, this) ) {
var last = this.path[this.path.length - 1]; var last = this.path[this.path.length - 1];