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:
parent
4cbea7d486
commit
d1622040b6
|
|
@ -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})';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue