v2.5.0: added a safety check to bee AI
This commit is contained in:
@@ -187,12 +187,17 @@ public class Bee extends Mob {
|
||||
|
||||
@Override
|
||||
protected boolean getCloser(int target) {
|
||||
if (alignment == Alignment.ALLY && enemy == null && buffs(AllyBuff.class).isEmpty()){
|
||||
if (alignment == Alignment.ALLY && enemy == null && buffs(AllyBuff.class).isEmpty()) {
|
||||
target = Dungeon.hero.pos;
|
||||
} else if (enemy != null && Actor.findById(potHolder) == enemy) {
|
||||
target = enemy.pos;
|
||||
} else if (potPos != -1 && (state == WANDERING || Dungeon.level.distance(target, potPos) > 3))
|
||||
this.target = target = potPos;
|
||||
} else if (potPos != -1 && (state == WANDERING || Dungeon.level.distance(target, potPos) > 3)) {
|
||||
if (!Dungeon.level.insideMap(potPos)){
|
||||
potPos = -1;
|
||||
} else {
|
||||
this.target = target = potPos;
|
||||
}
|
||||
}
|
||||
return super.getCloser( target );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user