mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Ignore zero-sections on a per-case basis
This commit is contained in:
@ -65,10 +65,6 @@ namespace osu.Game.Rulesets.Difficulty.Skills
|
||||
/// </summary>
|
||||
private void saveCurrentPeak()
|
||||
{
|
||||
// Ignore sections with 0 strain to avoid edge cases of long maps with a lot of spacing between objects (e.g. /b/2351871).
|
||||
if (currentSectionPeak == 0)
|
||||
return;
|
||||
|
||||
strainPeaks.Add(currentSectionPeak);
|
||||
}
|
||||
|
||||
@ -104,9 +100,13 @@ namespace osu.Game.Rulesets.Difficulty.Skills
|
||||
double difficulty = 0;
|
||||
double weight = 1;
|
||||
|
||||
// Sections with 0 strain are excluded to avoid worst-case time complexity of the following sort (e.g. /b/2351871).
|
||||
// These sections will not contribute to the difficulty.
|
||||
var peaks = GetCurrentStrainPeaks().Where(p => p > 0);
|
||||
|
||||
// Difficulty is the weighted sum of the highest strains from every section.
|
||||
// We're sorting from highest to lowest strain.
|
||||
foreach (double strain in GetCurrentStrainPeaks().OrderByDescending(d => d))
|
||||
foreach (double strain in peaks.OrderByDescending(d => d))
|
||||
{
|
||||
difficulty += strain * weight;
|
||||
weight *= DecayWeight;
|
||||
|
Reference in New Issue
Block a user