From 01b8b67ffd7478bc337b1b94dd0251033ea7406a Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 25 Jun 2023 19:30:28 -0500 Subject: [PATCH] mobs respect invisibility again --- src/engine/ai/MobileFSM.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index f618fa91..fb8bc63c 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -59,7 +59,7 @@ public class MobileFSM { } } public static void AttackPlayer(Mob mob, PlayerCharacter target) { - if (mob.getMobBase().getSeeInvis() < target.getHidden() || !target.isAlive()) { + if(!mob.canSee(target)){ mob.setCombatTarget(null); return; } @@ -221,6 +221,10 @@ public class MobileFSM { return false; if (mob.mobPowers.isEmpty()) return false; + if(!mob.canSee((PlayerCharacter) mob.getCombatTarget())){ + mob.setCombatTarget(null); + return false; + } if (mob.nextCastTime == 0) mob.nextCastTime = System.currentTimeMillis(); return mob.nextCastTime <= System.currentTimeMillis();