From 93a91f9d413ae9b11820038df39e4f25af47c415 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 2 Mar 2023 19:11:51 -0600 Subject: [PATCH] fixed null exception in aggro --- src/engine/ai/MobileFSM.java | 9 ++++++--- src/engine/ai/utilities/CombatUtilities.java | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index 09072a41..c4342c56 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -1652,12 +1652,15 @@ public class MobileFSM { PlayerCharacter target = (PlayerCharacter) mob.getCombatTarget(); HashMap eligiblePowers = mob.mobPowers; for(Map.Entry power : mob.mobPowers.entrySet()) { - ConcurrentHashMap effects = target.getEffects(); PowersBase pwr= PowersManager.getPowerByToken(power.getKey()); for(ActionsBase act : pwr.getActions()){ String des = act.stackType; - if(target.getEffects().containsKey(des)){ - eligiblePowers.remove(power.getKey()); + try { + if (target.getEffects() != null && target.getEffects().containsKey(des) == true) { + eligiblePowers.remove(power.getKey()); + } + }catch(Exception ex){ + } } diff --git a/src/engine/ai/utilities/CombatUtilities.java b/src/engine/ai/utilities/CombatUtilities.java index 4941cd4e..56976ffd 100644 --- a/src/engine/ai/utilities/CombatUtilities.java +++ b/src/engine/ai/utilities/CombatUtilities.java @@ -449,8 +449,8 @@ public class CombatUtilities { weapon = agent.getEquip().get(2).getItemBase(); } if(weapon != null){ - minDmg = weapon.getMinDamage(); - maxDmg = weapon.getMaxDamage(); + minDmg = getMinDmg(weapon.getMinDamage(),agent,weapon); + maxDmg = getMaxDmg(weapon.getMaxDamage(),agent, weapon); dt = weapon.getDamageType(); }else{ minDmg = agent.getMobBase().getDamageMin();