mirror of
https://github.com/ppy/osu
synced 2025-02-26 23:51:04 +00:00
Fix beat playing while paused
This commit is contained in:
parent
c883c97bab
commit
0f9ff32cdc
@ -42,6 +42,8 @@ namespace osu.Game.Graphics.Containers
|
||||
private EffectControlPoint defaultEffect;
|
||||
private TrackAmplitudes defaultAmplitudes;
|
||||
|
||||
protected bool IsBeatSyncedWithTrack { get; private set; }
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
Track track = null;
|
||||
@ -65,10 +67,16 @@ namespace osu.Game.Graphics.Containers
|
||||
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 @@ namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
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
Block a user