Skip to content

Commit

Permalink
Copy license Config table rather than passing by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
citRaTTV committed Dec 10, 2023
1 parent ea8756c commit 0901c90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ end)

RegisterNUICallback('requestLicenses', function(_, cb)
local licensesMeta = PlayerData.metadata["licences"]
local availableLicenses = Config.Cityhalls[closestCityhall].licenses
for license, data in pairs(availableLicenses) do
if data.metadata and not licensesMeta[data.metadata] then
availableLicenses[license] = nil
local availableLicenses = {}
for license, data in pairs(Config.Cityhalls[closestCityhall].licenses) do
if not data.metadata or licensesMeta[data.metadata] then
availableLicenses[license] = data
end
end
cb(availableLicenses)
Expand Down

0 comments on commit 0901c90

Please sign in to comment.