Skip to content

Commit

Permalink
fixed the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Givikap120 committed Jun 16, 2024
1 parent 15fbad0 commit accbf8b
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,26 +109,23 @@ public List<TimedDifficultyAttributes> CalculateTimed([NotNull] IEnumerable<Mod>
var progressiveBeatmap = new ProgressiveCalculationBeatmap(Beatmap);
var difficultyObjects = getDifficultyHitObjects().ToArray();

foreach (var obj in difficultyObjects)
{
// Implementations expect the progressive beatmap to only contain top-level objects from the original beatmap.
// At the same time, we also need to consider the possibility DHOs may not be generated for any given object,
// so we'll add all remaining objects up to the current point in time to the progressive beatmap.
for (int i = progressiveBeatmap.HitObjects.Count; i < Beatmap.HitObjects.Count; i++)
{
if (obj != difficultyObjects[^1] && Beatmap.HitObjects[i].StartTime > obj.BaseObject.StartTime)
break;
int currentIndex = 0;

progressiveBeatmap.HitObjects.Add(Beatmap.HitObjects[i]);
}
foreach (var obj in Beatmap.HitObjects)
{
progressiveBeatmap.HitObjects.Add(obj);

foreach (var skill in skills)
while (currentIndex < difficultyObjects.Length && difficultyObjects[currentIndex].BaseObject.GetEndTime() <= obj.GetEndTime())
{
cancellationToken.ThrowIfCancellationRequested();
skill.Process(obj);
foreach (var skill in skills)
{
cancellationToken.ThrowIfCancellationRequested();
skill.Process(difficultyObjects[currentIndex]);
}
currentIndex++;

Check failure on line 125 in osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs

View workflow job for this annotation

GitHub Actions / Code Quality

Blank lines are missing, expected minimum 1 instead of 0 in osu.Game\Rulesets\Difficulty\DifficultyCalculator.cs on line 125
}

attribs.Add(new TimedDifficultyAttributes(obj.EndTime * clockRate, CreateDifficultyAttributes(progressiveBeatmap, playableMods, skills, clockRate)));
attribs.Add(new TimedDifficultyAttributes(obj.GetEndTime(), CreateDifficultyAttributes(progressiveBeatmap, playableMods, skills, clockRate)));
}

return attribs;
Expand Down

0 comments on commit accbf8b

Please sign in to comment.