mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
fix(package): run onExit if point was removed within it's distance
This commit is contained in:
@@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user