From fdbfe2d6d21863165ed038a7ac3a76f76c3f27b2 Mon Sep 17 00:00:00 2001 From: geoffbeier Date: Fri, 5 Jun 2020 03:45:04 -0400 Subject: [PATCH] use non-deprecated function to check for sounds directory and assert that it was created/exists --- demo/main.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/demo/main.lua b/demo/main.lua index 8caab23..d9481d6 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -649,9 +649,13 @@ function love.load() 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") + pathinfo = love.filesystem.getInfo("sounds") end + assert(pathinfo.type == 'directory', '"sounds" exists in ' .. + love.filesystem.getRealDirectory('sounds') .. ' but is not a directory') sound = sfxr.newSound()