Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
refactor(client): don't use native to get coords when it already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
BerkieBb committed Apr 19, 2022
1 parent 0b19610 commit 27619a3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions client.lua
Expand Up @@ -389,15 +389,14 @@ local function EnableTarget()
end
else sleep += 20 end
if not success then
local closestDis, closestZone, playerCoords
if Config.DrawSprite then playerCoords = GetEntityCoords(playerPed) end
local closestDis, closestZone
for k, zone in pairs(Zones) do
if distance < (closestDis or Config.MaxDistance) and distance <= zone.targetoptions.distance and zone:isPointInside(coords) then
closestDis = distance
closestZone = zone
end
if Config.DrawSprite then
if #(playerCoords - zone.center) < (zone.targetoptions.drawDistance or Config.DrawDistance) then
if #(coords - zone.center) < (zone.targetoptions.drawDistance or Config.DrawDistance) then
listSprite[k] = zone
else
listSprite[k] = nil
Expand Down

0 comments on commit 27619a3

Please sign in to comment.