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:
Zooandtoshko authored and GitHub committed 2025-05-04 17:58:50 +02:00
1 parent a9728663ca
commit 4491ad3599
1 file changed
+9 -2
+9 -2
View File
@@ -122,8 +122,15 @@ local function removeZone(zone)
insideZones[zone.id] = nil
table.remove(exitingZones, exitingZones:indexOf(zone))
table.remove(enteringZones, enteringZones:indexOf(zone))
local exitingIndex = exitingZones:indexOf(zone)
if exitingIndex then
table.remove(exitingZones, exitingIndex)
end
local enteringIndex = enteringZones:indexOf(zone)
if enteringIndex then
table.remove(enteringZones, enteringIndex)
end
end
CreateThread(function()