Browse Source

1 second delay for mob movements

magicbox-1.5.2
FatBoy-DOTC 1 year ago
parent
commit
e3d6a32554
  1. 8
      src/engine/mobileAI/MobAI.java

8
src/engine/mobileAI/MobAI.java

@ -721,6 +721,14 @@ public class MobAI { @@ -721,6 +721,14 @@ public class MobAI {
try {
if(mob.getTimestamps().containsKey("lastChase") == false) {
mob.getTimestamps().put("lastChase", System.currentTimeMillis());
return;//ensure mob timestamps have the lastChase parameter
}
if(mob.getTimestamps().get("lastChase") + 1000 < System.currentTimeMillis())
return; // only allows mobs to chase once a second
if (!MovementUtilities.canMove(mob))
return;

Loading…
Cancel
Save