fix(package): run onExit if point was removed within it's distance

This commit is contained in:
Luke
2023-03-02 09:35:45 +01:00
parent c92575d8e2
commit b6af7e7166

View File

@@ -40,6 +40,9 @@ export class Point<T = unknown> {
}
remove = () => {
const coords = Vector3.fromArray(GetEntityCoords(cache.ped, false));
const distance = coords.distance(this.coords);
if (distance < this.distance && this.onExit) this.onExit();
points = points.filter((point) => point.id !== this.id);
};
}