From 2bb734430522f6f7fb3e36cb12130b37cdc77bdd Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sun, 22 Jun 2014 16:52:12 -0700 Subject: [PATCH] Reporting townspeople should send the guard to the player's last known locatio n - more than once --- moonlight/src/AISprite.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/moonlight/src/AISprite.js b/moonlight/src/AISprite.js index 40fb4ae..867d069 100644 --- a/moonlight/src/AISprite.js +++ b/moonlight/src/AISprite.js @@ -378,7 +378,7 @@ var AISprite = function(game, x, y, key, frame) { this.action_chaseplayer = function() { - if ( this.path.length > 1 && + if ( this.path.length > 0 && this.path_index >= this.path.length && hasState(this, STATE_RUNNINGTOREPORT) ) { delState(this, STATE_RUNNINGTOREPORT); @@ -410,8 +410,10 @@ var AISprite = function(game, x, y, key, frame) { var aiSprites = game.state.states.game.aiSprites; this.target = nearestInGroup(this, aiSprites, "townsfolk-guard"); } else if ( hasState(this, STATE_RUNNINGTOLIGHT) == false ) { - if ( this.target.rotation_timer !== null ) + if ( this.target.rotation_timer !== null ) { this.target.rotation_timer.stop(); + this.target.rotation_timer = null; + } this.target.path_purge(); this.target.setAwarenessEffect(STATE_ALERTED); this.target.target = this.lastSawPlayerAt;