mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
fix(zones/shared): ensure safe removal of zones from entering and exiting lists (#1)
Co-authored-by: toshko <toshko0003@gmail.com>
This commit is contained in:
@@ -122,8 +122,15 @@ local function removeZone(zone)
|
|||||||
|
|
||||||
insideZones[zone.id] = nil
|
insideZones[zone.id] = nil
|
||||||
|
|
||||||
table.remove(exitingZones, exitingZones:indexOf(zone))
|
local exitingIndex = exitingZones:indexOf(zone)
|
||||||
table.remove(enteringZones, enteringZones:indexOf(zone))
|
if exitingIndex then
|
||||||
|
table.remove(exitingZones, exitingIndex)
|
||||||
|
end
|
||||||
|
|
||||||
|
local enteringIndex = enteringZones:indexOf(zone)
|
||||||
|
if enteringIndex then
|
||||||
|
table.remove(enteringZones, enteringIndex)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
|
|||||||
Reference in New Issue
Block a user