Browse Source

randomized patrol delays

master
FatBoy-DOTC 1 year ago
parent
commit
fd9c5d06af
  1. 2
      src/engine/ai/MobileFSM.java

2
src/engine/ai/MobileFSM.java

@ -180,7 +180,7 @@ public class MobileFSM {
mob.stopPatrolTime = System.currentTimeMillis(); mob.stopPatrolTime = System.currentTimeMillis();
return; return;
} }
int patrolDelay = ThreadLocalRandom.current().nextInt(MBServerStatics.AI_PATROL_DIVISOR) + (int)(MBServerStatics.AI_PATROL_DIVISOR * 0.5f); int patrolDelay = ThreadLocalRandom.current().nextInt((int)(MBServerStatics.AI_PATROL_DIVISOR * 0.5f), MBServerStatics.AI_PATROL_DIVISOR);
if (mob.stopPatrolTime + (patrolDelay * 1000) > System.currentTimeMillis()) if (mob.stopPatrolTime + (patrolDelay * 1000) > System.currentTimeMillis())
//early exit while waiting to patrol again //early exit while waiting to patrol again
return; return;

Loading…
Cancel
Save