From 1b0091937f450a58b94c48607456a7b81a7d31d0 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Mon, 5 Apr 2021 12:07:21 +0200 Subject: [PATCH] fix: replace deprecated function --- sonic-radiance.love/game/init.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sonic-radiance.love/game/init.lua b/sonic-radiance.love/game/init.lua index 4ce5989..414068b 100644 --- a/sonic-radiance.love/game/init.lua +++ b/sonic-radiance.love/game/init.lua @@ -94,7 +94,7 @@ function Game:getMetadataFile(absolute) local dir = "" if absolute then dir = love.filesystem.getSaveDirectory() .. "/" - if not love.filesystem.exists(dir) then + if not utils.filesystem.exists(dir) then love.filesystem.createDirectory( "" ) end end @@ -104,11 +104,10 @@ function Game:getMetadataFile(absolute) return filepath end - function Game:getMetadata() local metadata = {} local filepath = self:getMetadataFile(true) - if love.filesystem.exists("metadata.save") then + if utils.filesystem.exists("metadata.save") then metadata = binser.readFile(filepath)[1] else metadata = self:newMetadata() @@ -153,7 +152,7 @@ function Game:read(save_id) self.slot = save_id if (self.slot > 0) then local filepath = self:getSaveFile(self.slot, true) - if love.filesystem.exists("save" .. self.slot .. ".save") then + if utils.filesystem.exists("save" .. self.slot .. ".save") then local loadedDatas = binser.readFile(filepath) self:setData(loadedDatas[1]) @@ -175,7 +174,7 @@ function Game:getSaveFile(saveslot, absolute) local dir = "" if absolute then dir = love.filesystem.getSaveDirectory() .. "/" - if not love.filesystem.exists(dir) then + if not utils.filesystem.exists(dir) then love.filesystem.createDirectory( "" ) end end @@ -188,7 +187,7 @@ end function Game:resetSaves() for i=1, self.slotNumber do local filepath = self:getSaveFile(i, true) - if love.filesystem.exists("save" .. i .. ".save") then + if utils.filesystem.exists("save" .. i .. ".save") then love.filesystem.remove( "save" .. i .. ".save" ) end end