diff --git a/src/engine/mobileAI/Threads/MobAIThread.java b/src/engine/mobileAI/Threads/MobAIThread.java index b3699879..f727c0e2 100644 --- a/src/engine/mobileAI/Threads/MobAIThread.java +++ b/src/engine/mobileAI/Threads/MobAIThread.java @@ -1,11 +1,10 @@ package engine.mobileAI.Threads; import engine.gameManager.ConfigManager; -import engine.mobileAI.MobAI; import engine.gameManager.ZoneManager; +import engine.mobileAI.MobAI; import engine.objects.Mob; import engine.objects.Zone; -import engine.server.MBServerStatics; import org.pmw.tinylog.Logger; public class MobAIThread implements Runnable{ @@ -17,20 +16,22 @@ public class MobAIThread implements Runnable{ // Thread constructor public MobAIThread() { - Logger.info(" MobAIThread thread has started!"); + //cache config value for mobile casting delay + + AI_CAST_FREQUENCY = Float.parseFloat(ConfigManager.MB_AI_CAST_FREQUENCY.getValue()); + AI_BASE_AGGRO_RANGE = (int) (60 * Float.parseFloat(ConfigManager.MB_AI_AGGRO_RANGE.getValue())); } @Override public void run() { - //cache config value for mobile casting delay - AI_CAST_FREQUENCY = Float.parseFloat(ConfigManager.MB_AI_CAST_FREQUENCY.getValue()); - AI_BASE_AGGRO_RANGE = (int)(60 * Float.parseFloat(ConfigManager.MB_AI_AGGRO_RANGE.getValue())); - while (true) { - for (Zone zone : ZoneManager.getAllZones()) { - for (Mob mob : zone.zoneMobSet) { + Logger.info(" MobAIThread thread has started!"); + while (true) { + + for (Zone zone : ZoneManager.getAllZones()) + for (Mob mob : zone.zoneMobSet) try { if (mob != null) MobAI.DetermineAction(mob); @@ -38,10 +39,10 @@ public class MobAIThread implements Runnable{ Logger.error("Mob: " + mob.getName() + " UUID: " + mob.getObjectUUID() + " ERROR: " + e); e.printStackTrace(); } - } - } } + } + public static void startAIThread() { Thread aiThread; aiThread = new Thread(new MobAIThread());