Stop chasing me if you can't see me at the end of your path
This commit is contained in:
@@ -987,12 +987,18 @@ var AISprite = function(game, x, y, key, frame) {
|
|||||||
|
|
||||||
if ( this.path_index >= this.path.length ) {
|
if ( this.path_index >= this.path.length ) {
|
||||||
this.path_tween_stop();
|
this.path_tween_stop();
|
||||||
|
if ( x.canSeeSprite(player, false) == true ) {
|
||||||
this.path_set(player, true);
|
this.path_set(player, true);
|
||||||
this.path_tween_start();
|
this.path_tween_start();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ( this.path_set(player, this.blocked(true)) == true )
|
||||||
|
if ( x.canSeeSprite(player, false) == true ) {
|
||||||
|
this.path_tween_stop();
|
||||||
} else {
|
} else {
|
||||||
if ( this.path_set(player, this.blocked(true)) )
|
|
||||||
this.path_tween_start();
|
this.path_tween_start();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user