Browse Source

fixed null exception in aggro

master
FatBoy-DOTC 2 years ago
parent
commit
93a91f9d41
  1. 9
      src/engine/ai/MobileFSM.java
  2. 4
      src/engine/ai/utilities/CombatUtilities.java

9
src/engine/ai/MobileFSM.java

@ -1652,12 +1652,15 @@ public class MobileFSM {
PlayerCharacter target = (PlayerCharacter) mob.getCombatTarget(); PlayerCharacter target = (PlayerCharacter) mob.getCombatTarget();
HashMap<Integer,Integer> eligiblePowers = mob.mobPowers; HashMap<Integer,Integer> eligiblePowers = mob.mobPowers;
for(Map.Entry<Integer,Integer> power : mob.mobPowers.entrySet()) { for(Map.Entry<Integer,Integer> power : mob.mobPowers.entrySet()) {
ConcurrentHashMap<String, Effect> effects = target.getEffects();
PowersBase pwr= PowersManager.getPowerByToken(power.getKey()); PowersBase pwr= PowersManager.getPowerByToken(power.getKey());
for(ActionsBase act : pwr.getActions()){ for(ActionsBase act : pwr.getActions()){
String des = act.stackType; String des = act.stackType;
if(target.getEffects().containsKey(des)){ try {
eligiblePowers.remove(power.getKey()); if (target.getEffects() != null && target.getEffects().containsKey(des) == true) {
eligiblePowers.remove(power.getKey());
}
}catch(Exception ex){
} }
} }

4
src/engine/ai/utilities/CombatUtilities.java

@ -449,8 +449,8 @@ public class CombatUtilities {
weapon = agent.getEquip().get(2).getItemBase(); weapon = agent.getEquip().get(2).getItemBase();
} }
if(weapon != null){ if(weapon != null){
minDmg = weapon.getMinDamage(); minDmg = getMinDmg(weapon.getMinDamage(),agent,weapon);
maxDmg = weapon.getMaxDamage(); maxDmg = getMaxDmg(weapon.getMaxDamage(),agent, weapon);
dt = weapon.getDamageType(); dt = weapon.getDamageType();
}else{ }else{
minDmg = agent.getMobBase().getDamageMin(); minDmg = agent.getMobBase().getDamageMin();

Loading…
Cancel
Save