owner.resetPath();
if (!inBounds()) {
failed();
return;
}
owner.setPath(new Path(owner.getX(), owner.getY(), affectedMob
.getX(), affectedMob.getY()));
return; // Target is moving.. correcting path
} else {
if (GameEngine.getTime() - startTime <= 10000) // Make NPCs
// give a 10
// second
// chase
{
if (loc != null) {
if (!inBounds()) {
failed();
return;
}
} else if (owner.nextTo(affectedMob) && owner.finishedPath()) {
return; // if stuck behind gate, keep chasing in case it
// opens
}
if (owner.isBusy())
return;
owner.setPath(new Path(owner.getX(), owner.getY(), affectedMob
.getX(), affectedMob.getY()));
return;
} else
failed();
}