mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 22:33:05 +08:00
Fix storyboard outro time potentially running too long
This commit is contained in:
parent
9bcc6bf6da
commit
679ec986d5
@ -214,7 +214,9 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
Assert.That(oneTime.EndTime, Is.EqualTo(4000 + loop_duration));
|
||||
|
||||
StoryboardSprite manyTimes = background.Elements.OfType<StoryboardSprite>().Single(s => s.Path == "many-times.png");
|
||||
Assert.That(manyTimes.EndTime, Is.EqualTo(9000 + 40 * loop_duration));
|
||||
// It is intentional that we don't consider the loop count (40) as part of the end time calculation to match stable's handling.
|
||||
// If we were to include the loop count, storyboards which loop for stupid long loop counts would continue playing the outro forever.
|
||||
Assert.That(manyTimes.EndTime, Is.EqualTo(9000 + loop_duration));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,12 @@ namespace osu.Game.Storyboards
|
||||
public readonly int TotalIterations;
|
||||
|
||||
public override double StartTime => LoopStartTime + CommandsStartTime;
|
||||
public override double EndTime => StartTime + CommandsDuration * TotalIterations;
|
||||
|
||||
public override double EndTime =>
|
||||
// In an ideal world, we would multiply the command duration by TotalIterations here.
|
||||
// Unfortunately this would clash with how stable handled end times, and results in some storyboards playing outro
|
||||
// sequences for minutes or hours.
|
||||
StartTime + CommandsDuration;
|
||||
|
||||
/// <summary>
|
||||
/// Construct a new command loop.
|
||||
|
Loading…
Reference in New Issue
Block a user