1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:43:01 +08:00

Merge pull request #15409 from smoogipoo/fix-pp-counter-rate-adjust

Fix PP counter showing incorrect values with rate adjustment mods
This commit is contained in:
Dean Herbert 2021-11-03 00:06:13 +09:00 committed by GitHub
commit 73b09f3b3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View File

@ -58,6 +58,11 @@ namespace osu.Game.Rulesets.Difficulty
return CreateDifficultyAttributes(Beatmap, playableMods, skills, clockRate);
}
/// <summary>
/// Calculates the difficulty of the beatmap and returns a set of <see cref="TimedDifficultyAttributes"/> representing the difficulty at every relevant time value in the beatmap.
/// </summary>
/// <param name="mods">The mods that should be applied to the beatmap.</param>
/// <returns>The set of <see cref="TimedDifficultyAttributes"/>.</returns>
public List<TimedDifficultyAttributes> CalculateTimed(params Mod[] mods)
{
preProcess(mods);
@ -77,7 +82,7 @@ namespace osu.Game.Rulesets.Difficulty
foreach (var skill in skills)
skill.ProcessInternal(hitObject);
attribs.Add(new TimedDifficultyAttributes(hitObject.EndTime, CreateDifficultyAttributes(progressiveBeatmap, playableMods, skills, clockRate)));
attribs.Add(new TimedDifficultyAttributes(hitObject.EndTime * clockRate, CreateDifficultyAttributes(progressiveBeatmap, playableMods, skills, clockRate)));
}
return attribs;

View File

@ -11,9 +11,21 @@ namespace osu.Game.Rulesets.Difficulty
/// </summary>
public class TimedDifficultyAttributes : IComparable<TimedDifficultyAttributes>
{
/// <summary>
/// The non-clock-adjusted time value at which the attributes take effect.
/// </summary>
public readonly double Time;
/// <summary>
/// The attributes.
/// </summary>
public readonly DifficultyAttributes Attributes;
/// <summary>
/// Creates new <see cref="TimedDifficultyAttributes"/>.
/// </summary>
/// <param name="time">The non-clock-adjusted time value at which the attributes take effect.</param>
/// <param name="attributes">The attributes.</param>
public TimedDifficultyAttributes(double time, DifficultyAttributes attributes)
{
Time = time;