fix: only stop the music when it change
This commit is contained in:
parent
9a9615b120
commit
85e687276f
1 changed files with 3 additions and 1 deletions
|
@ -169,7 +169,9 @@ end
|
|||
|
||||
function Assets:setMusic(filename)
|
||||
if filename ~= nil then
|
||||
love.audio.stop( )
|
||||
if (self.music ~= nil) then
|
||||
self.music:stop()
|
||||
end
|
||||
self.music = love.audio.newSource(filename, "stream" )
|
||||
self.music:setVolume(core.options.data.audio.music / 100)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue