Browse Source

Patrol points only set once.

feature-workorder
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 {
//guards inherit barracks patrol points dynamically //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()) { if (barracks != null && barracks.patrolPoints != null && !barracks.getPatrolPoints().isEmpty()) {
mob.patrolPoints = barracks.patrolPoints; mob.patrolPoints = barracks.patrolPoints;
} else { } else {
randomGuardPatrolPoint(mob); randomGuardPatrolPoint(mob);
return; return;
}
} }
}
if (mob.lastPatrolPointIndex > mob.patrolPoints.size() - 1) if (mob.lastPatrolPointIndex > mob.patrolPoints.size() - 1)
mob.lastPatrolPointIndex = 0; mob.lastPatrolPointIndex = 0;

Loading…
Cancel
Save