Browse Source

Squiggly cleanup in thread.

feature-workorder
MagicBot 1 year ago
parent
commit
37ca8c90e2
  1. 23
      src/engine/mobileAI/Threads/MobAIThread.java

23
src/engine/mobileAI/Threads/MobAIThread.java

@ -1,11 +1,10 @@ @@ -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{ @@ -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{ @@ -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());

Loading…
Cancel
Save