From a890abd11008ccb5ec8055685d6b5d8c1070d1f9 Mon Sep 17 00:00:00 2001 From: Selt <83926739+seltonmt012@users.noreply.github.com> Date: Thu, 30 Jul 2026 01:45:05 +0200 Subject: [PATCH] fix(esx_lib): make table.dump work and drop the shadowed contains table.dump called its own table argument as a function, so it threw "attempt to call a table value" for every table that had at least one entry. An empty table returned "{ } " and a non-table returned tostring, which is why it looks fine until you actually dump something. table.contains was defined twice in the same file. Lua keeps the second one, so the annotated version further up was unreachable. Removed the unreachable one; behaviour is unchanged. --- [core]/esx_lib/imports/table/shared.lua | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/[core]/esx_lib/imports/table/shared.lua b/[core]/esx_lib/imports/table/shared.lua index 37d51ee6..57940f09 100644 --- a/[core]/esx_lib/imports/table/shared.lua +++ b/[core]/esx_lib/imports/table/shared.lua @@ -34,13 +34,6 @@ function xLib.table.searchForKey(tbl, item) return nil end ----@param tbl table ----@param item any ----@return boolean -function xLib.table.contains(tbl, item) - return xLib.table.searchForKey(tbl, item) ~= nil -end - ---@param tbl table ---@param filter fun(value:any, key:any):boolean ---@return table @@ -118,7 +111,7 @@ function xLib.table.dump(tbl) local s = '{ ' for k,v in pairs(tbl) do if type(k) ~= 'number' then k = '"'..k..'"' end - s = s .. '['..k..'] = ' .. tbl(v) .. ',' + s = s .. '['..k..'] = ' .. xLib.table.dump(v) .. ',' end return s .. '} ' else