From 75e44da055367f193216001065f171199064a27c Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 28 Dec 2021 14:59:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbgm=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=97=AE=E9=A2=98=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E9=9F=B3=E9=A2=91bug=20close=20#557?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/bgm.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zframework/bgm.lua b/Zframework/bgm.lua index 64ed7b0e..6d36c4d0 100644 --- a/Zframework/bgm.lua +++ b/Zframework/bgm.lua @@ -72,10 +72,11 @@ end local function task_fadeOut(src) while true do coroutine.yield() + if tostring(src):find('NULL')then return end local v=src:getVolume()-.025*volume src:setVolume(v>0 and v or 0) if v<=0 then - src:pause() + src:stop() return true end end @@ -143,7 +144,6 @@ function BGM.play(name,args) end SourceObjList[name].source:setLooping(not args:sArg('-noloop')) BGM.lastPlayed=BGM.nowPlay - BGM.playing:seek(0) BGM.playing:play() BGM.onChange(name) end