1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-15 03:13:45 +00:00

Merge pull request #782 from FunkinCrew/cyn0x8/funkinsound-persist

[PUBLIC PR] If FunkinSound.persist is true, don't destroy it when switching states
This commit is contained in:
Cameron Taylor 2024-09-22 13:30:17 -04:00 committed by GitHub
commit 5c6d72d8d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -550,11 +550,12 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
/**
* Stop all sounds in the pool and allow them to be recycled.
*/
public static function stopAllAudio(musicToo:Bool = false):Void
public static function stopAllAudio(musicToo:Bool = false, persistToo:Bool = false):Void
{
for (sound in pool)
{
if (sound == null) continue;
if (!persistToo && sound.persist) continue;
if (!musicToo && sound == FlxG.sound.music) continue;
sound.destroy();
}