From 5cf19460648e4c0b9adbaa5c67b61021b172a3be Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Thu, 28 Nov 2024 10:17:03 +0100 Subject: [PATCH] fix shaddowing global table --- smartfs.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/smartfs.lua b/smartfs.lua index 07dfb34..7675e61 100644 --- a/smartfs.lua +++ b/smartfs.lua @@ -146,13 +146,13 @@ function smartfs._makeState_(form, player, params, is_inv) load = function(self, file_name) local file = io.open(file_name, "r") if file then - local table = core.deserialize(file:read("*all")) + local data = core.deserialize(file:read("*all")) file:close() - if type(table) == "table" then - if table.size then - self._size = table.size + if type(data) == "table" then + if data.size then + self._size = data.size end - for _, val in pairs(table.ele) do + for _, val in pairs(data.ele) do self:element(val.type, val) end return true