v3.0.0: adjusted mob aggroing behaviour when they are hit by target

This commit is contained in:
Evan Debenham
2024-10-23 14:24:07 -04:00
parent 95147e8a58
commit d7a40b2bae

View File

@@ -703,7 +703,8 @@ public abstract class Mob extends Char {
}
//if attacked by something else than current target, and that thing is closer, switch targets
if (this.enemy == null
//or if attacked by target, simply update target position
if (this.enemy == null || enemy == this.enemy
|| (enemy != this.enemy && (Dungeon.level.distance(pos, enemy.pos) < Dungeon.level.distance(pos, this.enemy.pos)))) {
aggro(enemy);
target = enemy.pos;