Skip to content

Commit

Permalink
fix(es_extended/client/imports/point) Modify Point:delete()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Tiziukas committed Jan 20, 2025
1 parent 153212e commit aa8f0ee
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion [core]/es_extended/client/imports/point.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aa8f0ee

Please sign in to comment.