mirror of https://github.com/ppy/osu
Fix beat playing while paused
This commit is contained in:
parent
c883c97bab
commit
0f9ff32cdc
|
@ -42,6 +42,8 @@ public class BeatSyncedContainer : Container
|
|||
private EffectControlPoint defaultEffect;
|
||||
private TrackAmplitudes defaultAmplitudes;
|
||||
|
||||
protected bool IsBeatSyncedWithTrack { get; private set; }
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
Track track = null;
|
||||
|
@ -65,10 +67,16 @@ protected override void Update()
|
|||
effectPoint = beatmap.ControlPointInfo.EffectPointAt(currentTrackTime);
|
||||
|
||||
if (timingPoint.BeatLength == 0)
|
||||
{
|
||||
IsBeatSyncedWithTrack = false;
|
||||
return;
|
||||
}
|
||||
|
||||
IsBeatSyncedWithTrack = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsBeatSyncedWithTrack = false;
|
||||
currentTrackTime = Clock.CurrentTime;
|
||||
timingPoint = defaultTiming;
|
||||
effectPoint = defaultEffect;
|
||||
|
|
|
@ -75,7 +75,13 @@ protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint,
|
|||
{
|
||||
base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);
|
||||
|
||||
if (beatIndex < firstBeat || !firstBeat.HasValue)
|
||||
if (!IsBeatSyncedWithTrack)
|
||||
{
|
||||
firstBeat = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!firstBeat.HasValue || beatIndex < firstBeat)
|
||||
firstBeat = Math.Max(0, (beatIndex / 16 + 1) * 16);
|
||||
|
||||
if (beatIndex > firstBeat)
|
||||
|
|
Loading…
Reference in New Issue