fix: only stop the music when it change

This commit is contained in:
Kazhnuz 2021-04-21 17:12:20 +02:00
parent 9a9615b120
commit 85e687276f

View file

@ -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