Browse Source

patrol point index

master
FatBoy-DOTC 1 year ago
parent
commit
33c6f1c74d
  1. 12
      src/engine/ai/MobileFSMManager.java
  2. 4
      src/engine/objects/Mob.java

12
src/engine/ai/MobileFSMManager.java

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
package engine.ai;
import engine.gameManager.MovementManager;
import engine.gameManager.SessionManager;
import engine.gameManager.ZoneManager;
import engine.objects.Mob;
@ -37,7 +38,18 @@ public class MobileFSMManager { @@ -37,7 +38,18 @@ public class MobileFSMManager {
execution();
}
};
for (Zone zone : ZoneManager.getAllZones()) {
for (Mob mob : zone.zoneMobSet) {
try {
MovementManager.translocate(mob,mob.patrolPoints.get(0), null);
} catch (Exception e) {
Logger.error("Mob: " + mob.getName() + " UUID: " + mob.getObjectUUID() + " ERROR: " + e);
e.printStackTrace();
}
}
}
alive = true;
Thread t = new Thread(worker, "MobileFSMManager");

4
src/engine/objects/Mob.java

@ -1978,12 +1978,8 @@ public class Mob extends AbstractIntelligenceAgent { @@ -1978,12 +1978,8 @@ public class Mob extends AbstractIntelligenceAgent {
patrolRadius = 60;
Vector3fImmutable newPatrolPoint = Vector3fImmutable.getRandomPointInCircle(this.getBindLoc(), patrolRadius);
if(i == 0){
MovementManager.translocate(this,newPatrolPoint, null);
}
this.patrolPoints.add(newPatrolPoint);
}
}
if (this.BehaviourType == null)
this.BehaviourType = this.getMobBase().fsm;

Loading…
Cancel
Save