Love2D 11.3 port

This commit is contained in:
WesleyCSJ
2020-08-11 22:31:35 -03:00
parent b130b88080
commit 487ac002f5
9 changed files with 25 additions and 25 deletions
+3 -3
View File
@@ -20,7 +20,7 @@ function MultiSource:cleanup(older_than)
for instance, lastPlayed in pairs(self.instances) do
local age = now - lastPlayed
if age > older_than and instance:isStopped() then
if age > older_than and not instance:isPlaying() then
self.instances[instance] = nil
end
end
@@ -28,7 +28,7 @@ end
function MultiSource:getStoppedOrNewInstance()
for instance in pairs(self.instances) do
if instance:isStopped() then return instance end
if not instance:isPlaying() then return instance end
end
return self.source:clone()
end
@@ -88,4 +88,4 @@ multisource.new = function(source)
return setmetatable({source = source, instances = {}}, MultiSourceMt)
end
return multisource
return multisource