1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 02:43:02 +08:00

Merge pull request #13941 from Henry-YSLin/update-TargetBeatContainer

Update `OsuModTarget` to take advantage of the new `BeatSyncedContainer`
This commit is contained in:
Dean Herbert 2021-07-20 12:30:49 +09:00 committed by GitHub
commit f415dc18a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -353,6 +353,7 @@ namespace osu.Game.Rulesets.Osu.Mods
public TargetBeatContainer(double firstHitTime)
{
this.firstHitTime = firstHitTime;
AllowMistimedEventFiring = false;
Divisor = 1;
}
@ -374,8 +375,7 @@ namespace osu.Game.Rulesets.Osu.Mods
int timeSignature = (int)timingPoint.TimeSignature;
// play metronome from one measure before the first object.
// TODO: Use BeatSyncClock from https://github.com/ppy/osu/pull/13894.
if (Clock.CurrentTime < firstHitTime - timingPoint.BeatLength * timeSignature)
if (BeatSyncClock.CurrentTime < firstHitTime - timingPoint.BeatLength * timeSignature)
return;
sample.Frequency.Value = beatIndex % timeSignature == 0 ? 1 : 0.5f;