From 62e4fea5ad42922b05d541a1119e4b65ce0b1ddf Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Tue, 15 Mar 2022 10:34:22 +0000 Subject: [PATCH] refactor(init): set cache[key] after triggering onCache Allow for comparison of new and old values by checking cache[key] against the value sent as an argument. --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index e959ec4..b167034 100644 --- a/init.lua +++ b/init.lua @@ -188,11 +188,11 @@ end) AddEventHandler('ox_lib:updateCache', function(data) for key, value in pairs(data) do - cache[key] = value - if lib.onCache[key] then lib.onCache[key](value) end + + cache[key] = value end end)