mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Fix beat playing while paused
This commit is contained in:
@ -42,6 +42,8 @@ namespace osu.Game.Graphics.Containers
|
|||||||
private EffectControlPoint defaultEffect;
|
private EffectControlPoint defaultEffect;
|
||||||
private TrackAmplitudes defaultAmplitudes;
|
private TrackAmplitudes defaultAmplitudes;
|
||||||
|
|
||||||
|
protected bool IsBeatSyncedWithTrack { get; private set; }
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
Track track = null;
|
Track track = null;
|
||||||
@ -65,10 +67,16 @@ namespace osu.Game.Graphics.Containers
|
|||||||
effectPoint = beatmap.ControlPointInfo.EffectPointAt(currentTrackTime);
|
effectPoint = beatmap.ControlPointInfo.EffectPointAt(currentTrackTime);
|
||||||
|
|
||||||
if (timingPoint.BeatLength == 0)
|
if (timingPoint.BeatLength == 0)
|
||||||
|
{
|
||||||
|
IsBeatSyncedWithTrack = false;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IsBeatSyncedWithTrack = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
IsBeatSyncedWithTrack = false;
|
||||||
currentTrackTime = Clock.CurrentTime;
|
currentTrackTime = Clock.CurrentTime;
|
||||||
timingPoint = defaultTiming;
|
timingPoint = defaultTiming;
|
||||||
effectPoint = defaultEffect;
|
effectPoint = defaultEffect;
|
||||||
|
@ -75,7 +75,13 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
{
|
{
|
||||||
base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);
|
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);
|
firstBeat = Math.Max(0, (beatIndex / 16 + 1) * 16);
|
||||||
|
|
||||||
if (beatIndex > firstBeat)
|
if (beatIndex > firstBeat)
|
||||||
|
Reference in New Issue
Block a user