From 4558fbe0d426acdd7fb359160ddb5bb032e27fd7 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 28 Mar 2017 06:25:10 +0300 Subject: [PATCH] [Database] Save non-numerical player tables instead of using fixed list --- scripts/database.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/database.lua b/scripts/database.lua index cdfe5c92c1..990f7b0b0f 100644 --- a/scripts/database.lua +++ b/scripts/database.lua @@ -121,12 +121,12 @@ end function Database:SavePlayer(dbPid, data) - local validCategories = { "settings", "character", "location", "stats", "attributes", "attributeSkillIncreases", "skills", "skillProgress" } - for category, categoryTable in pairs(data) do - if table.contains(validCategories, category) then + if table.usesNumericalKeys(categoryTable) then + print(category .. " was array!") + elseif category ~= "login" then print("Saving category " .. category) - local tempTable = table.shallowcopy(categoryTable) + local tempTable = table.shallowCopy(categoryTable) tempTable.dbPid = dbPid self:InsertRow("player_" .. category, tempTable) end