1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-11-23 13:43:46 +00:00

Fix a bug where vocals would restart after a song ends

This commit is contained in:
EliteMasterEric 2024-09-11 04:22:33 -04:00
parent 4cbea7d486
commit d1622040b6
2 changed files with 13 additions and 0 deletions

View file

@ -567,6 +567,14 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
return sound;
}
/**
* Produces a string representation suitable for debugging.
*/
public function toString():String
{
return 'FunkinSound(${this._label})';
}
}
/**

View file

@ -113,6 +113,11 @@ class SoundGroup extends FlxTypedGroup<FunkinSound>
public function play(forceRestart:Bool = false, startTime:Float = 0.0, ?endTime:Float)
{
forEachAlive(function(sound:FunkinSound) {
if (sound.length < startTime)
{
// trace('Queuing sound (${sound.toString()} past its length! Skipping...)');
return;
}
sound.play(forceRestart, startTime, endTime);
});
}