From 28729d740341ff81c015ad297cf1ace054a77d32 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Fri, 14 Mar 2025 11:19:15 +1100 Subject: [PATCH] fix(grid): only returned cached grid entries if filter matches Look into optimisations in the future. --- imports/grid/shared.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imports/grid/shared.lua b/imports/grid/shared.lua index 6d7cc8b..34682a7 100644 --- a/imports/grid/shared.lua +++ b/imports/grid/shared.lua @@ -86,7 +86,8 @@ end function lib.grid.getNearbyEntries(point, filter) local minX, maxX, minY, maxY = getGridDimensions(point, xDelta, yDelta) - if gridCache.minX == minX and + if gridCache.filter == filter and + gridCache.minX == minX and gridCache.maxX == maxX and gridCache.minY == minY and gridCache.maxY == maxY then @@ -123,6 +124,7 @@ function lib.grid.getNearbyEntries(point, filter) gridCache.minY = minY gridCache.maxY = maxY gridCache.entries = entries + gridCache.filter = filter return entries end