Skip to content

Commit

Permalink
feat(client/zones): set cache.coords
Browse files Browse the repository at this point in the history
People keep asking for coords to be added to cache, but it be problematic
to spam the events system every tick with that information.
If zones is loaded, we can set cache locally without relying on events.
  • Loading branch information
thelindat committed Sep 11, 2022
1 parent 99b146d commit 77ff8e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion imports/zones/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,10 @@ local tick

CreateThread(function()
while true do
local coords = GetEntityCoords(cache.ped)
table.wipe(inside)

local coords = GetEntityCoords(cache.ped)
cache.coords = coords
insideCount = 0

for _, zone in pairs(Zones) do
Expand Down

0 comments on commit 77ff8e9

Please sign in to comment.