Making townsfolk report you to a guard

This commit is contained in:
2014-06-19 18:56:51 -07:00
parent 4acce7dc20
commit e31f32286f

View File

@@ -1073,6 +1073,8 @@ var AISprite = function(game, x, y, key, frame) {
if ( (this.path.length < 1) || this.path_index >= this.path.length) {
for ( var i = 0 ; i < length(aiSprites); i++ ) {
spr = aiSprites[i];
if ( spr.sprite_group !== "townsfolk-guard" )
continue;
var dist = new Phaser.Line(this.x, this.y, spr.x, spr.y);
if ( (lastdist == 0.0 ) || (dist.length < lastdist) ) {
lastdist = dist;