From 0850a858c9d9c5fa96163cd2d329ad0e14c966b3 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Tue, 17 Jun 2014 21:02:53 -0700 Subject: [PATCH] Stop chasing me if you can't see me at the end of your path --- moonlight/js/moonlight-skulk.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index d594f45..d8f6b56 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -987,13 +987,13 @@ var AISprite = function(game, x, y, key, frame) { if ( this.path_index >= this.path.length ) { this.path_tween_stop(); - if ( x.canSeeSprite(player, false) == true ) { + if ( this.canSeeSprite(player, false) == true ) { this.path_set(player, true); this.path_tween_start(); } } else { if ( this.path_set(player, this.blocked(true)) == true ) - if ( x.canSeeSprite(player, false) == true ) { + if ( this.canSeeSprite(player, false) == true ) { this.path_tween_stop(); } else { this.path_tween_start();