mkafrin / PolyZone

PolyZone is a FiveM mod to define zones of different shapes and test whether a point is inside or outside of the zone
MIT License
204 stars 189 forks source link

Metatables don't transfer when zones returned from exports #19

Closed mkafrin closed 4 years ago

mkafrin commented 4 years ago

Exports don't support metatables, so the functions of a zone aren't being transferred when a zone is returned from an export. The best way I see to fix this is to have an ensureMetatable() function that re-connects the metatable to the zone instance. It is boilerplate and annoying, but necessary given the limitations of exports.

mkafrin commented 4 years ago

Added fix in ff864d59bf9b3c7ea321f99a78b633b8f90b1943