v3.0.0: fixed AI behaviour causing allies to attack eachother rarely
This commit is contained in:
@@ -1205,7 +1205,7 @@ public abstract class Mob extends Char {
|
|||||||
if (!recentlyAttackedBy.isEmpty()){
|
if (!recentlyAttackedBy.isEmpty()){
|
||||||
boolean swapped = false;
|
boolean swapped = false;
|
||||||
for (Char ch : recentlyAttackedBy){
|
for (Char ch : recentlyAttackedBy){
|
||||||
if (ch != null && fieldOfView[ch.pos] && ch.invisible == 0 && !isCharmedBy(ch)) {
|
if (ch != null && alignment != ch.alignment && fieldOfView[ch.pos] && ch.invisible == 0 && !isCharmedBy(ch)) {
|
||||||
if (canAttack(ch) || Dungeon.level.distance(pos, ch.pos) < Dungeon.level.distance(pos, enemy.pos)) {
|
if (canAttack(ch) || Dungeon.level.distance(pos, ch.pos) < Dungeon.level.distance(pos, enemy.pos)) {
|
||||||
enemy = ch;
|
enemy = ch;
|
||||||
target = ch.pos;
|
target = ch.pos;
|
||||||
|
|||||||
Reference in New Issue
Block a user