From c2e14a4f94a147d2392e038a1cfb3dccbb964646 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Thu, 19 Jun 2014 19:33:57 -0700 Subject: [PATCH] Making townsfolk report you to a guard --- moonlight/js/moonlight-skulk.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index 40251de..c03a1d7 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -1073,8 +1073,13 @@ var AISprite = function(game, x, y, key, frame) { console.log(nearest); this.target = nearest; } - if ( this.target !== null ) + if ( this.target !== null ) { + if ( this.target(canSeeSprite, this) == true ) { + this.path_tween_stop(); + this.path_purge(); + } this.chasetarget(this.target); + } } this.action_huntplayer = function()