forked from MagicBane/Server
Squiggly cleanup in thread.
This commit is contained in:
@@ -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()));
|
||||
|
||||
Logger.info(" MobAIThread thread has started!");
|
||||
|
||||
while (true) {
|
||||
for (Zone zone : ZoneManager.getAllZones()) {
|
||||
|
||||
for (Mob mob : zone.zoneMobSet) {
|
||||
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user