Skip to content

Commit

Permalink
Fix loops & start points
Browse files Browse the repository at this point in the history
  • Loading branch information
VioletXF committed Aug 16, 2023
1 parent 8632a67 commit 2a2d603
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 9 additions & 1 deletion Assets/Scripts/BMSParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,15 @@ public void Parse(string path, bool addReadyMeasure = false, bool metaOnly = fal
for (var j = 0; j < dataCount; ++j)
{
var val = data.Substring(j * 2, 2);
if (val == "00") continue;
if (val == "00")
{
if (i == 0 && timelines.Count == 0)
{
timelines.Add(0, new TimeLine(TempKey)); // add ghost timeline to make sure the game gets correct start time
}

continue;
}

var g = Gcd(j, dataCount);
// ReSharper disable PossibleLossOfFraction
Expand Down
8 changes: 4 additions & 4 deletions Assets/Scripts/RhythmControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class GameState
public GameState(Chart chart, bool addReadyMeasure)
{
Judge = new Judge(chart.ChartMeta.Rank);
if(addReadyMeasure)
if(chart.Measures.Count > 1)
firstTiming = chart.Measures[1].Timelines[0].Timing;
// if(addReadyMeasure)
// if(chart.Measures.Count > 1)
// firstTiming = chart.Measures[1].Timelines[0].Timing;

}

Expand Down Expand Up @@ -591,7 +591,7 @@ private async void LoadGame()
var (sound, bgainfo) = ((Sound sound, (int id, string path) bgainfo))tasks[i].Result;
wavSounds[i] = sound; // To prevent concurrent modification, we should wait for all tasks to complete before assigning wavSounds.
wavSounds[i].setLoopCount(0);
if (bgainfo.id != -1)
{
bgas.Add(bgainfo); // Same as above.
Expand Down

0 comments on commit 2a2d603

Please sign in to comment.