From aa8f0eee822d03baad9edb7089df86c1178d13f7 Mon Sep 17 00:00:00 2001 From: Tizas <141794006+Tiziukas@users.noreply.github.com> Date: Mon, 20 Jan 2025 12:34:35 +0000 Subject: [PATCH] fix(es_extended/client/imports/point) Modify Point:delete() Currently, you are unable to delete the point from within the point without the points being broken. This fix was created by Kasey and I slightly refactored it. --- [core]/es_extended/client/imports/point.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/[core]/es_extended/client/imports/point.lua b/[core]/es_extended/client/imports/point.lua index 5c505cc82..b4f3da5c8 100644 --- a/[core]/es_extended/client/imports/point.lua +++ b/[core]/es_extended/client/imports/point.lua @@ -39,9 +39,23 @@ function Point:constructor(properties) end function Point:delete() - ESX.RemovePointInternal(self.handle) + if not nearby[self.handle] then + return + end + nearby[self.handle] = nil + + if self.leave then + self:leave() + end + + if next(nearby) == nil then + loop = false + end + + ESX.RemovePointInternal(self.handle) end + function Point:toggle(hidden) if hidden == nil then hidden = not self.hidden