Making townsfolk report you to a guard

This commit is contained in:
2014-06-19 20:51:47 -07:00
parent 4b719273a1
commit 1b351d662e

View File

@@ -1061,7 +1061,7 @@ var AISprite = function(game, x, y, key, frame) {
this.target = nearestInGroup(this, aiSprites, "townsfolk-guard"); this.target = nearestInGroup(this, aiSprites, "townsfolk-guard");
} }
if ( this.target !== null ) { if ( this.target !== null ) {
if ( (typeof this.target.canSeeSprite !== undefined && if ( ((typeof this.target.canSeeSprite !== undefined) &&
(this.target.canSeeSprite(this) == true)) || (this.target.canSeeSprite(this) == true)) ||
(game.physics.arcade.collide(this, this.target) == true) ) { (game.physics.arcade.collide(this, this.target) == true) ) {
if ( hasState(this, STATE_RUNNINGTOLIGHT) == true ) { if ( hasState(this, STATE_RUNNINGTOLIGHT) == true ) {