Making townsfolk report you to a guard

This commit is contained in:
2014-06-19 21:03:31 -07:00
parent cd340f9b8c
commit d9b3282930

View File

@@ -1057,8 +1057,10 @@ var AISprite = function(game, x, y, key, frame) {
this.action_reportplayer = function() this.action_reportplayer = function()
{ {
if ( (this.path.length < 1) || this.path_index >= this.path.length) { if ( (this.path.length < 1) || this.path_index >= this.path.length) {
var aiSprites = game.state.states.game.aiSprites; if ( hasState(this, STATE_RUNNINGTOLIGHT) == false ) {
this.target = nearestInGroup(this, aiSprites, "townsfolk-guard"); var aiSprites = game.state.states.game.aiSprites;
this.target = nearestInGroup(this, aiSprites, "townsfolk-guard");
}
} }
if ( this.target !== null ) { if ( this.target !== null ) {
var targetseesyou = false; var targetseesyou = false;