Skip to content

Commit

Permalink
fmod的loadBank2方法找不到文件的时候不再直接报错
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Jun 27, 2024
1 parent 3ac6602 commit a23ea4f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/fmod20221/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ end
---@return FMOD.Studio.Bank?
function M.loadBank2(path,flag)
if not studio then return end
assert(love.filesystem.getInfo(path),"File not found")
if not love.filesystem.getInfo(path) then
MSG.new('warn',"Bank file not found: "..path)
return
end
local file=love.filesystem.newFile(path)
local data,size=file:read('data')
local bank,res=studio:loadBankMemory(data:getPointer(),size,0,flag or M.FMOD_STUDIO_LOAD_BANK_NORMAL)
Expand Down

0 comments on commit a23ea4f

Please sign in to comment.