From 82d5f4ec3e2352e117aa5ddbdd75205057886b35 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Sun, 23 Jan 2022 21:31:20 -0500 Subject: [PATCH] Update main.lua --- main.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index ad75fd8e..59e5de4c 100644 --- a/main.lua +++ b/main.lua @@ -862,7 +862,8 @@ local function attemptPathfind(entity) pathsChecked[entity.InitSeed] = true return true end - if EID.GameUpdateCount - lastPathfindFrame < 10 then return false end + -- Don't reattempt pathfinding more than 3 times a second, unless this is a new entity + if pathsChecked[entity.InitSeed] == false and EID.GameUpdateCount - lastPathfindFrame < 10 then return false end -- Spawn a custom NPC entity to attempt a pathfind to the target pickup, then remove it afterwards pathCheckerEntity = game:Spawn(17, 3169, EID.player.Position, nullVector, EID.player, 0, 4354)