From 0901c908c64821bd2cbb4eaa54dc5cec5d8f08e1 Mon Sep 17 00:00:00 2001 From: citRa Date: Sun, 10 Dec 2023 14:21:45 -0400 Subject: [PATCH] Copy license Config table rather than passing by reference --- client/main.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/main.lua b/client/main.lua index 81dbd83..6651946 100644 --- a/client/main.lua +++ b/client/main.lua @@ -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)