Skip to content

Commit

Permalink
Update main.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Yozzaxia1311 committed Nov 25, 2020
1 parent 5668ff5 commit ec71ced
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,26 @@ function love.load()
console.init()
initEngine()

local data = save.load("main.sav") or {}
if data.fullscreen then
megautils.setFullscreen(true)
end
if data.scale then
megautils.setScale(data.scale)
local data = save.load("main.sav")
if data then
if data.fullscreen then
megautils.setFullscreen(true)
end
if data.scale then
megautils.setScale(data.scale)
end
else
save.save("main.sav", {})
end

megautils.gotoState(globals.disclaimerState)
console.parse("exec autoexec")

io = nil -- Prevents the worst case scenerio involving external context files. Be careful, a bad context file could still wipe your save directory
require = nil
dofile = nil
loadfile = nil

console.parse("exec autoexec")
end

function love.resize(w, h)
Expand Down

0 comments on commit ec71ced

Please sign in to comment.