Browse Source

Patrol points only set once.

combat-2
MagicBot 1 year ago
parent
commit
3f416f83d3
  1. 17
      src/engine/mobileAI/MobAI.java

17
src/engine/mobileAI/MobAI.java

@ -266,17 +266,18 @@ public class MobAI { @@ -266,17 +266,18 @@ public class MobAI {
//guards inherit barracks patrol points dynamically
if (mob.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN) || mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) {
if (mob.patrolPoints == null || mob.patrolPoints.isEmpty())
if (mob.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN) || mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) {
Building barracks = mob.building;
Building barracks = mob.building;
if (barracks != null && barracks.patrolPoints != null && !barracks.getPatrolPoints().isEmpty()) {
mob.patrolPoints = barracks.patrolPoints;
} else {
randomGuardPatrolPoint(mob);
return;
if (barracks != null && barracks.patrolPoints != null && !barracks.getPatrolPoints().isEmpty()) {
mob.patrolPoints = barracks.patrolPoints;
} else {
randomGuardPatrolPoint(mob);
return;
}
}
}
if (mob.lastPatrolPointIndex > mob.patrolPoints.size() - 1)
mob.lastPatrolPointIndex = 0;

Loading…
Cancel
Save