mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 07:26:02 +01:00
refactor(package): use cache.ped for points
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { Vector3 } from '@nativewrappers/client';
|
import { Vector3 } from '@nativewrappers/client';
|
||||||
|
import { cache } from '../cache';
|
||||||
|
|
||||||
let points: Point[] = [];
|
let points: Point[] = [];
|
||||||
let nearbyPoints: Point[] = [];
|
let nearbyPoints: Point[] = [];
|
||||||
@@ -49,7 +50,7 @@ setInterval(() => {
|
|||||||
nearbyCount = 0;
|
nearbyCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const coords = Vector3.fromArray(GetEntityCoords(PlayerPedId(), false));
|
const coords = Vector3.fromArray(GetEntityCoords(cache.ped, false));
|
||||||
|
|
||||||
if (closestPoint && coords.distance(closestPoint.coords) > closestPoint.distance) {
|
if (closestPoint && coords.distance(closestPoint.coords) > closestPoint.distance) {
|
||||||
closestPoint = undefined;
|
closestPoint = undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user