Fixed an edge case with the last save commit

This commit is contained in:
Ishaan Bhardwaj 2021-05-22 21:42:14 -04:00
parent c56f290921
commit e1741440f2

View File

@ -1,6 +1,11 @@
local binser = require 'libs.binser' local binser = require 'libs.binser'
function loadSave() function loadSave()
local info = love.filesystem.getInfo(love.filesystem.getSaveDirectory())
if not info or info.type ~= "directory" then
love.filesystem.remove(love.filesystem.getSaveDirectory())
love.filesystem.createDirectory(love.filesystem.getSaveDirectory())
end
config = loadFromFile( config = loadFromFile(
love.filesystem.getSaveDirectory() .. '/config.sav' love.filesystem.getSaveDirectory() .. '/config.sav'
) )