diff --git a/load/save.lua b/load/save.lua index b8825ad..c658171 100644 --- a/load/save.lua +++ b/load/save.lua @@ -1,8 +1,10 @@ local binser = require 'libs.binser' function loadSave() - local info = love.filesystem.getInfo(love.filesystem.getSaveDirectory()) - if not info or info.type ~= "directory" then + local info = love.filesystem.getInfo( + love.filesystem.getSaveDirectory(), "directory" + ) + if not info then love.filesystem.remove(love.filesystem.getSaveDirectory()) love.filesystem.createDirectory(love.filesystem.getSaveDirectory()) end diff --git a/main.lua b/main.lua index 30b3b17..481c813 100644 --- a/main.lua +++ b/main.lua @@ -99,8 +99,8 @@ function love.keypressed(key, scancode) -- f12 is reserved for saving screenshots elseif scancode == "f12" then local ss_name = os.date("ss/%Y-%m-%d_%H-%M-%S.png") - local info = love.filesystem.getInfo("ss") - if not info or info.type ~= "directory" then + local info = love.filesystem.getInfo("ss", "directory") + if not info then love.filesystem.remove("ss") love.filesystem.createDirectory("ss") end