Skip to content

Commit

Permalink
Fix stepmania stop incorrect time placement when multiple stops are i…
Browse files Browse the repository at this point in the history
…nbetween a beat
  • Loading branch information
WilliamQiufeng committed May 8, 2024
1 parent 8bfa0ba commit 5c841aa
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Quaver.API/Maps/Parsers/Stepmania/StepFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,10 @@ private Qua ConvertChart(StepFileChart chart)
while (bpmAndStops.Count > 0 && totalBeats + beatTimePerRow > bpmAndStops.Peek().Beat)
{
var bpmOrStop = bpmAndStops.Dequeue();
if (bpmOrStop.IsBpm)
// Fraction of row before the timing point is placed
var insertTime = currentTime + millisecondsPerBeat * (bpmOrStop.Beat - totalBeats);
if (bpmOrStop is StepFileBPM bpm)
{
var bpm = bpmOrStop.Bpm;
// Fraction of row before the timing point is placed
var insertTime = currentTime + millisecondsPerBeat * (bpm.Beat - totalBeats);
var newTimingPointInfo = new TimingPointInfo
{
StartTime = insertTime,
Expand Down Expand Up @@ -337,7 +335,7 @@ private Qua ConvertChart(StepFileChart chart)
var stopMilliseconds = stop.Seconds * 1000;
qua.SliderVelocities.Add(new SliderVelocityInfo
{
StartTime = currentTime,
StartTime = insertTime,
Multiplier = 0
});
// Shift the entire time forward
Expand Down

0 comments on commit 5c841aa

Please sign in to comment.