From defc7c0e8b470e14984e021af2526052374f3785 Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Sat, 16 Aug 2025 01:03:45 -0400 Subject: [PATCH 1/3] blip tweak --- lib/utility/client/utility.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/utility/client/utility.lua b/lib/utility/client/utility.lua index 45cbe7f..8379c8f 100644 --- a/lib/utility/client/utility.lua +++ b/lib/utility/client/utility.lua @@ -126,7 +126,7 @@ function Utility.CreateBlip(coords, sprite, color, scale, label, shortRange, dis AddTextEntry(label, label) BeginTextCommandSetBlipName(label) EndTextCommandSetBlipName(blip) - blipIDs[tostring(blip)] = true + blipIDs[tostring(blip)] = blip return blip end @@ -150,7 +150,7 @@ function Utility.CreateEntityBlip(entity, sprite, color, scale, label, shortRang AddTextEntry(label, label) BeginTextCommandSetBlipName(label) EndTextCommandSetBlipName(blip) - blipIDs[tostring(blip)] = true + blipIDs[tostring(blip)] = blip return blip end @@ -158,8 +158,8 @@ end ---@param blip number ---@return boolean function Utility.RemoveBlip(blip) - if not blipIDs[tostring(blip)] then return false end - RemoveBlip(blip) + if not blipIDs[tostring(blip)] then return false, print("NO BLIP BY ID") end + RemoveBlip(blipIDs[tostring(blip)]) blipIDs[tostring(blip)] = nil return true end From 0fc872a10211e02d53993f7597e21b5b5e3c3120 Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Sat, 16 Aug 2025 05:56:25 -0400 Subject: [PATCH 2/3] patch for vector4 --- lib/points/client/pointsv2.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/points/client/pointsv2.lua b/lib/points/client/pointsv2.lua index 7793f71..fd5dd0f 100644 --- a/lib/points/client/pointsv2.lua +++ b/lib/points/client/pointsv2.lua @@ -69,7 +69,7 @@ function Point.StartLoop() end end else - local distance = #(coords.xyz - point.coords.xyz) + local distance = #(vector3(coords.x, coords.y, coords.z) - vector3(point.coords.x, point.coords.y, point.coords.z)) if distance < point.distance then if not point.inside then point.inside = true From 58242b421399cff29ec66d330bd1115ba2fb3b48 Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Sat, 16 Aug 2025 07:04:00 -0400 Subject: [PATCH 3/3] possible fix Before only one point could exist per cell. This corrects that but im unsure on the impact to performance or grids --- lib/points/client/pointsv2.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/points/client/pointsv2.lua b/lib/points/client/pointsv2.lua index fd5dd0f..5500047 100644 --- a/lib/points/client/pointsv2.lua +++ b/lib/points/client/pointsv2.lua @@ -102,7 +102,8 @@ function Point.Register(id, target, distance, args, _onEnter, _onExit) self.inside = false -- Track if player is inside self.args = args or {} local grid = Grid.GetCellByCoords(coords) - self.cellKey = Grid.GetCellId(coords) + -- OLD CODE: self.cellKey = Grid.GetCellId(coords) -- This caused points to overwrite each other in same cell + self.cellKey = id -- Use unique ID instead of cell coordinates grid[self.cellKey] = self Point.All[id] = self Point.StartLoop() @@ -132,14 +133,17 @@ function Point.UpdateCoords(id, coords) if not point then return end local newGrid = Grid.GetCellByCoords(coords) - if not newGrid or newGrid[point.cellKey] then return end + if not newGrid then return end + -- OLD CODE: if not newGrid or newGrid[point.cellKey] then return end -- This prevented adding points to cells with existing points + local oldGrid = Grid.GetCellByCoords(point.coords) if oldGrid then oldGrid[point.cellKey] = nil end -- Add to new grid point.coords = coords - point.cellKey = string.format("%d_%d", newGrid.x, newGrid.y) + -- OLD CODE: point.cellKey = string.format("%d_%d", newGrid.x, newGrid.y) -- This used cell coordinates instead of unique ID + point.cellKey = id -- Keep using the unique ID newGrid[point.cellKey] = point return true end