From e3d6a325543f272f6e0e84d74b6be83b32161924 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 16 Oct 2023 14:02:48 -0500 Subject: [PATCH] 1 second delay for mob movements --- src/engine/mobileAI/MobAI.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 38864cac..4b7a14ef 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -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;