From 914536670abb08b44bb192260387d5503c47fe86 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sat, 5 Jul 2014 12:43:58 -0700 Subject: [PATCH] Bug in implementation of #35, failed to skip ourselves --- moonlight/src/AISprite.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moonlight/src/AISprite.js b/moonlight/src/AISprite.js index 38355db..db3bafc 100644 --- a/moonlight/src/AISprite.js +++ b/moonlight/src/AISprite.js @@ -347,7 +347,7 @@ var AISprite = function(game, x, y, key, frame) { var aiSprites = game.state.states.game.aiSprites; var hasBeenReset = false; aiSprites.forEach(function(spr) { - if ( hasBeenReset == true ) + if ( hasBeenReset == true || spr == this) return; if ( game.physics.arcade.overlap(spr, this) ) { var last = this.path[this.path.length - 1];