From c197a385c5e07cf336e6fa7f281d023dd453187b Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 18 Apr 2024 21:25:27 -0500 Subject: [PATCH] mob aggro issue --- src/engine/mobileAI/MobAI.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 063ee152..21e9c7e7 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -658,6 +658,17 @@ public class MobAI { //no players loaded, no need to proceed if (mob.playerAgroMap.isEmpty()) { + //attempt to reload agro map + HashSet players = WorldGrid.getObjectsInRangePartial(mob.loc, mob.getAggroRange(), MBServerStatics.MASK_PLAYER); + if(players.size() > 0){ + for(AbstractWorldObject player : players){ + if(mob.playerAgroMap.containsKey(player.getObjectUUID()) == false) { + PlayerCharacter pc = (PlayerCharacter) player; + mob.playerAgroMap.put(pc.getObjectUUID(), 0.0f); + } + } + } + if(mob.getCombatTarget() != null) mob.setCombatTarget(null); return;