From 2c71af4339d68ff641ee154aa2038a0467c279a7 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Tue, 17 Jun 2014 23:17:51 -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, 4 insertions(+) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index aac5e55..6af3d28 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -713,6 +713,10 @@ var AISprite = function(game, x, y, key, frame) { } this.canSeeSprite = function(spr, debug) { + var vd = this.view_distance; + if ( hasState(this, STATE_ALERTED) ) { + vd = vd * 2; + var xd = (spr.x - this.x); if ( xd < 0 ) xd = -(xd);