v2.5.0: added a safety check to bee AI

This commit is contained in:
Evan Debenham
2024-09-05 11:29:02 -04:00
parent 85d619ceff
commit 75da7a40e1
@@ -191,8 +191,13 @@ public class Bee extends Mob {
target = Dungeon.hero.pos; target = Dungeon.hero.pos;
} else if (enemy != null && Actor.findById(potHolder) == enemy) { } else if (enemy != null && Actor.findById(potHolder) == enemy) {
target = enemy.pos; target = enemy.pos;
} else if (potPos != -1 && (state == WANDERING || Dungeon.level.distance(target, potPos) > 3)) } else if (potPos != -1 && (state == WANDERING || Dungeon.level.distance(target, potPos) > 3)) {
if (!Dungeon.level.insideMap(potPos)){
potPos = -1;
} else {
this.target = target = potPos; this.target = target = potPos;
}
}
return super.getCloser( target ); return super.getCloser( target );
} }