slam icon indicating copy to clipboard operation
slam copied to clipboard

remove_stopped function doesn't remove stopped

Open OmarShehata opened this issue 12 years ago • 0 comments

Whenever I would call "sound:stop()" it would only stop one instance, even if there were many playing. This was apparently due to the remove_stopped function indiscriminately removing sound instances even if they were still playing. A simply check fixed this and now calling stop() stops all playing instances

local function remove_stopped(sources) local remove = {} for s in pairs(sources) do if(s:isStopped())then remove[s] = true end---added the check here end for s in pairs(remove) do sources[s] = nil end end

OmarShehata avatar Oct 02 '13 05:10 OmarShehata