You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When removing lib.zone uses zone.id as key for all tables where it removes zone. But tables enteringZones and exitingZones use different indexing. This causes possible conflict when wrong zone is removed from those tables. It also breaks the iteration if the index is removed in between.
localfunctionremoveZone(self)
Zones[self.id] =nilinsideZones[self.id] =nilenteringZones[self.id] =nilexitingZones[self.id] =nilend...ifnotzone.insideZonethenzone.insideZone=trueifzone.onEnterthenenteringSize+=1enteringZones[enteringSize] =zoneendifzone.insideorzone.debugtheninsideZones[zone.id] =zoneendend...fori=1, enteringSizedoenteringZones[i]:onEnter()
end
Possible solution would be using zone.id as key for all tables. And re-create table as sorted array by distance if triggering exit/enter methods in distance order is important. From an optimization perspective it has a little effect really.
When removing lib.zone uses zone.id as key for all tables where it removes zone. But tables enteringZones and exitingZones use different indexing. This causes possible conflict when wrong zone is removed from those tables. It also breaks the iteration if the index is removed in between.
Possible solution would be using zone.id as key for all tables. And re-create table as sorted array by distance if triggering exit/enter methods in distance order is important. From an optimization perspective it has a little effect really.
And here without sorting.
The text was updated successfully, but these errors were encountered: