use non-deprecated function to check for sounds directory and assert that it was created/exists

This commit is contained in:
geoffbeier 2020-06-05 03:45:04 -04:00
parent 4e859aec86
commit fdbfe2d6d2

View File

@ -649,9 +649,13 @@ function love.load()
love.graphics.setBackgroundColor(200, 200, 200) love.graphics.setBackgroundColor(200, 200, 200)
if not love.filesystem.isDirectory("sounds") then local pathinfo = love.filesystem.getInfo("sounds")
if pathinfo == nil then
love.filesystem.createDirectory("sounds") love.filesystem.createDirectory("sounds")
pathinfo = love.filesystem.getInfo("sounds")
end end
assert(pathinfo.type == 'directory', '"sounds" exists in ' ..
love.filesystem.getRealDirectory('sounds') .. ' but is not a directory')
sound = sfxr.newSound() sound = sfxr.newSound()