From 508fac6168ab77fe35c6bf9a7be5d1ee7db654c1 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 7 May 2023 12:06:54 -0500 Subject: [PATCH] mobs use hate value to hot swap targets --- src/engine/ai/MobileFSM.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index eadc038d..4be1cf98 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -719,8 +719,8 @@ public class MobileFSM { for (Entry playerEntry : mob.playerAgroMap.entrySet()) { PlayerCharacter potentialTarget = PlayerCharacter.getFromCache((int)playerEntry.getKey()); if(potentialTarget != null && potentialTarget.getHateValue() > CurrentHateValue){ - CurrentHateValue = ((AbstractCharacter)playerEntry.getKey()).getHateValue(); - mostHatedTarget = PlayerCharacter.getFromCache((int)playerEntry.getKey()); + CurrentHateValue = potentialTarget.getHateValue(); + mostHatedTarget = potentialTarget; } } return mostHatedTarget;