From a5fe5ece504a7c25d1e74d8810a64aa89898b67e Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 25 Jul 2023 21:51:30 -0500 Subject: [PATCH] mobs use both enemy and notEnemy lists to determine proper agro --- 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 9ce4d179..fff028c6 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -430,8 +430,12 @@ public class MobileFSM { if (!aiAgent.canSee(loadedPlayer)) continue; // No aggro for this race type - if (aiAgent.notEnemy.contains(loadedPlayer.getRace().getRaceType().getMonsterType())) + if (aiAgent.notEnemy.size() > 0 && aiAgent.notEnemy.contains(loadedPlayer.getRace().getRaceType().getMonsterType()) == true) continue; + //mob has enemies and this player race is not it + if(aiAgent.enemy.size() > 0 && aiAgent.enemy.contains(loadedPlayer.getRace().getRaceType().getMonsterType()) == false){ + continue; + } if (MovementUtilities.inRangeToAggro(aiAgent, loadedPlayer)) { aiAgent.setCombatTarget(loadedPlayer); return;