mirror of
https://github.com/bakpakin/tiny-ecs.git
synced 2026-07-22 07:56:52 -06:00
Love2D 11.3 port
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user