From 30d44babe3ceebe67d64ae807185d4bca2eac95e Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Thu, 19 Jun 2014 20:54:00 -0700 Subject: [PATCH] Making townsfolk report you to a guard --- moonlight/js/moonlight-skulk.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index 9cd3a50..e8dd774 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -1062,9 +1062,11 @@ var AISprite = function(game, x, y, key, frame) { } if ( this.target !== null ) { var targetseesyou = false; - if ((typeof this.target.canSeeSprite !== undefined) && - (this.target.canSeeSprite(this) == true) ) - targetseesyou = true; + if (typeof this.target.canSeeSprite !== undefined) { + if (this.target.canSeeSprite(this) == true) + targetseesyou = true; + } + if ( targetseesyou || (game.physics.arcade.collide(this, this.target) == true) ) { if ( hasState(this, STATE_RUNNINGTOLIGHT) == true ) {