Skip to content

Commit

Permalink
Fix beat gen infinite loop (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
RileyTheFox authored Jun 9, 2023
1 parent 7e5bb3a commit 2f5067a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Assets/Script/Chart/BeatHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public void GenerateBeats() {
}
}

// Last beat should never be a strong beat if denominator is bigger than 4.
if (currentBeatInMeasure == currentTS.numerator - 1 && currentTS.denominator > 4) {
// Last beat of measure should never be a strong beat if denominator is bigger than 4.
if (currentBeatInMeasure == currentTS.numerator - 1 && currentTS.denominator > 4 && currentTick < lastTick + forwardStep) {
style = BeatStyle.WEAK;
}

Expand Down Expand Up @@ -142,7 +142,7 @@ public static uint GetLastTick(this MoonSong song)
{
foreach (var songObject in chart.chartObjects) {
if (songObject.tick <= lastTick) continue;

lastTick = songObject.tick;

if (songObject is MoonNote note)
Expand Down

0 comments on commit 2f5067a

Please sign in to comment.