diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 5dc2e425..8830b04c 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -309,16 +309,18 @@ public class MobAI { if (mob == null) return false; - if (mob.isPlayerGuard() == true) { - int contractID; + int contractID = 0; + + if (mob.isPlayerGuard() == true) { - if (mob.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN)) + if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) contractID = mob.guardCaptain.contract.getContractID(); else contractID = mob.contract.getContractID(); //exception for werewolf and werebear guard captains + if (Enum.MinionType.ContractToMinionMap.get(contractID).isMage() == false && contractID != 980111 && contractID != 980110) return false; } @@ -331,7 +333,7 @@ public class MobAI { // Mobile has no powers defined in mobbase or contract.. if (PowersManager.getPowersForRune(mob.getMobBaseID()).isEmpty() && - mob.getContract() != null && PowersManager.getPowersForRune(mob.getContract().getObjectUUID()).isEmpty()) + PowersManager.getPowersForRune(contractID).isEmpty()) return false; if (mob.nextCastTime == 0) @@ -372,10 +374,10 @@ public class MobAI { ArrayList contractEntries = new ArrayList<>(); if (mob.contract != null) - contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.contractUUID)); + contractEntries = PowersManager.getPowersForRune(mob.contractUUID); if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) - contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.guardCaptain.contractUUID)); + contractEntries = PowersManager.getPowersForRune(mob.guardCaptain.contractUUID); powerEntries.addAll(contractEntries); @@ -473,10 +475,10 @@ public class MobAI { ArrayList contractEntries = new ArrayList<>(); if (mob.contract != null) - contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.contractUUID)); + contractEntries = PowersManager.getPowersForRune(mob.contractUUID); if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) - contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.guardCaptain.contractUUID)); + contractEntries = PowersManager.getPowersForRune(mob.guardCaptain.contractUUID); powerEntries.addAll(contractEntries);