mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 19:22:54 +08:00
Fix textbox sample playback potentially crashing if called before load
This commit is contained in:
parent
07d4a025b0
commit
2bec8b82b3
@ -283,7 +283,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
return samples[RNG.Next(0, samples.Length)]?.GetChannel();
|
||||
}
|
||||
|
||||
private void playSample(FeedbackSampleType feedbackSample)
|
||||
private void playSample(FeedbackSampleType feedbackSample) => Schedule(() =>
|
||||
{
|
||||
if (Time.Current < sampleLastPlaybackTime + 15) return;
|
||||
|
||||
@ -300,7 +300,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
channel.Play();
|
||||
|
||||
sampleLastPlaybackTime = Time.Current;
|
||||
}
|
||||
});
|
||||
|
||||
private class OsuCaret : Caret
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user