|
|
@ -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; |
|
|
|