Making townsfolk report you to a guard

This commit is contained in:
2014-06-19 20:49:39 -07:00
parent eea3dfd07a
commit 4b719273a1

View File

@@ -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;