v3.0.0: fixed changes to mob code causing fleeing mobs to aggro

This commit is contained in:
Evan Debenham
2024-11-15 14:14:33 -05:00
parent 6173b6ead0
commit 8a7d640a81
@@ -704,12 +704,14 @@ public abstract class Mob extends Char {
//if attacked by something else than current target, and that thing is closer, switch targets //if attacked by something else than current target, and that thing is closer, switch targets
//or if attacked by target, simply update target position //or if attacked by target, simply update target position
if (state != FLEEING) {
if (state != HUNTING) { if (state != HUNTING) {
aggro(enemy); aggro(enemy);
target = enemy.pos; target = enemy.pos;
} else { } else {
recentlyAttackedBy.add(enemy); recentlyAttackedBy.add(enemy);
} }
}
if (buff(SoulMark.class) != null) { if (buff(SoulMark.class) != null) {
int restoration = Math.min(damage, HP+shielding()); int restoration = Math.min(damage, HP+shielding());
@@ -776,7 +778,7 @@ public abstract class Mob extends Char {
if (state == SLEEPING) { if (state == SLEEPING) {
state = WANDERING; state = WANDERING;
} }
if (!(src instanceof Corruption)) { if (!(src instanceof Corruption) && state != FLEEING) {
if (state != HUNTING) { if (state != HUNTING) {
alerted = true; alerted = true;
//assume the hero is hitting us in these common cases //assume the hero is hitting us in these common cases