-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Labels
Description
var self, routine;
self = this;
routine = {
enemies: false,
targetNearby: function () {
routine.enemies = self.findEnemies();
for (var i = 0; i <= routine.enemies.length; ++i) {
var enemy = routine.enemies[i];
if (enemy) {
var distance = self.distanceTo(enemy);
if (distance <= 35) {
return true;
} else {
return false;
}
} else {
return false;
}
}
return false;
}
};
while (routine.targetNearby()) {
self.say(routine.targetNearby());
}This code seems to confuse it. routine.targetNearby() should return a simple true or false if there is a target nearby that satisfies the distance requirement. It's returning [Object Object] as per the heros say. My best guess is that it's actually returning the function object itself instead of executing the function. but thats just a guess.