From d7a40b2bae9952b9d5efcb463fec575a1719797e Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 23 Oct 2024 14:24:07 -0400 Subject: [PATCH] v3.0.0: adjusted mob aggroing behaviour when they are hit by target --- .../shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index c94d33397..34675a523 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -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;