From 4b719273a1855d8142443c55745fb1d4693b572d Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Thu, 19 Jun 2014 20:49:39 -0700 Subject: [PATCH] Making townsfolk report you to a guard --- moonlight/js/moonlight-skulk.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index 1de2a77..1dbfc6a 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -1061,7 +1061,8 @@ var AISprite = function(game, x, y, key, frame) { this.target = nearestInGroup(this, aiSprites, "townsfolk-guard"); } if ( this.target !== null ) { - if ( (this.target.canSeeSprite(this) == true) || + if ( (typeof this.target.canSeeSprite !== undefined && + (this.target.canSeeSprite(this) == true)) || (game.physics.arcade.collide(this, this.target) == true) ) { if ( hasState(this, STATE_RUNNINGTOLIGHT) == true ) { return;