From 8a7d640a81ab635afa27c4464b307483a155cc40 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 15 Nov 2024 14:14:33 -0500 Subject: [PATCH] v3.0.0: fixed changes to mob code causing fleeing mobs to aggro --- .../shatteredpixeldungeon/actors/mobs/Mob.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 c9c20273e..c745d4117 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 @@ -704,11 +704,13 @@ public abstract class Mob extends Char { //if attacked by something else than current target, and that thing is closer, switch targets //or if attacked by target, simply update target position - if (state != HUNTING){ - aggro(enemy); - target = enemy.pos; - } else { - recentlyAttackedBy.add(enemy); + if (state != FLEEING) { + if (state != HUNTING) { + aggro(enemy); + target = enemy.pos; + } else { + recentlyAttackedBy.add(enemy); + } } if (buff(SoulMark.class) != null) { @@ -776,7 +778,7 @@ public abstract class Mob extends Char { if (state == SLEEPING) { state = WANDERING; } - if (!(src instanceof Corruption)) { + if (!(src instanceof Corruption) && state != FLEEING) { if (state != HUNTING) { alerted = true; //assume the hero is hitting us in these common cases