Update main.lua

This commit is contained in:
Buurazu authored and GitHub committed 2022-01-23 21:31:20 -05:00
1 parent 451d0ddafd
commit 82d5f4ec3e
1 file changed
+2 -1
+2 -1
View File
@@ -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)