From 6985dffda42927adf9c7e6108c6f99b350fe964b Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 9 Jan 2025 08:17:56 -0600 Subject: [PATCH] no more spamming console --- src/engine/mobileAI/MobAI.java | 12 ++++++------ src/engine/net/client/ClientConnection.java | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index cabe0d9d..174f9d62 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -321,20 +321,20 @@ public class MobAI { if (mob == null) return false; - if(mob.isPlayerGuard == true){ + if(mob.isPlayerGuard){ - int contractID; + int contractID = 0; - if(mob.BehaviourType.equals(Enum.MobBehaviourType.GuardMinion)) + if(mob.BehaviourType.equals(Enum.MobBehaviourType.GuardMinion) && mob.npcOwner != null) contractID = mob.npcOwner.contract.getContractID(); - else + else if(mob.contract != null) contractID = mob.contract.getContractID(); - if(Enum.MinionType.ContractToMinionMap.get(contractID).isMage() == false) + if(Enum.MinionType.ContractToMinionMap.containsKey(contractID) && !Enum.MinionType.ContractToMinionMap.get(contractID).isMage()) return false; } - if (mob.mobPowers.isEmpty()) + if (mob.mobPowers == null || mob.mobPowers.isEmpty()) return false; if (!mob.canSee((PlayerCharacter) mob.getCombatTarget())) { diff --git a/src/engine/net/client/ClientConnection.java b/src/engine/net/client/ClientConnection.java index ad113a6a..fc6dcef9 100644 --- a/src/engine/net/client/ClientConnection.java +++ b/src/engine/net/client/ClientConnection.java @@ -227,10 +227,10 @@ public class ClientConnection extends AbstractConnection { SessionManager.remSession( SessionManager.getSession(sessionID)); } catch (NullPointerException e) { - Logger - .error( - "Tried to remove improperly initialized session. Skipping." + - e); + //Logger + //.error( + //"Tried to remove improperly initialized session. Skipping." + + //e); } }