Fixed a bug where the game would sometimes not save on macOS

Version bump to beta5.2
This commit is contained in:
Ishaan Bhardwaj 2021-05-22 21:19:33 -04:00
parent 86e975f929
commit c56f290921
2 changed files with 13 additions and 5 deletions

View File

@ -1,8 +1,12 @@
local binser = require 'libs.binser' local binser = require 'libs.binser'
function loadSave() function loadSave()
config = loadFromFile('config.sav') config = loadFromFile(
highscores = loadFromFile('highscores.sav') love.filesystem.getSaveDirectory() .. '/config.sav'
)
highscores = loadFromFile(
love.filesystem.getSaveDirectory() .. '/highscores.sav'
)
end end
function loadFromFile(filename) function loadFromFile(filename)
@ -40,9 +44,13 @@ function initConfig()
end end
function saveConfig() function saveConfig()
binser.writeFile('config.sav', config) binser.writeFile(
love.filesystem.getSaveDirectory() .. '/config.sav', config
)
end end
function saveHighscores() function saveHighscores()
binser.writeFile('highscores.sav', highscores) binser.writeFile(
love.filesystem.getSaveDirectory() .. '/highscores.sav', highscores
)
end end

View File

@ -1 +1 @@
version = "v0.3-beta5.1" version = "v0.3-beta5.2"