diff --git a/itemcontroller.lua b/itemcontroller.lua index 111650a..6c0cd12 100644 --- a/itemcontroller.lua +++ b/itemcontroller.lua @@ -6,7 +6,7 @@ local Padding = require("gfx.padding") local CACHE_FILE = ".storage.cache" -local LOCK_FILE = ".storage.lock" +LOCK_FILE = ".storage.lock" local function lock() if fs.exists(LOCK_FILE) then @@ -51,7 +51,7 @@ local function loadState(fname, node) file.close() return Storage:fromSerializable(ser) end - controller = loadState(CACHE_FILE) + controller = loadState(fname) end if controller == nil then @@ -64,7 +64,7 @@ local function loadState(fname, node) end end controller = Storage:fromPeripherals(Storage.assumeHomogeneous(storageChests)) - saveState(controller, CACHE_FILE) + saveState(fname, controller) end return controller end