Skip to content

Commit

Permalink
Fix maxFruits count
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn committed Feb 16, 2024
1 parent 64a3f17 commit cb9b280
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PerformanceCalculator/Simulate/CatchSimulateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected override int GetMaxCombo(IBeatmap beatmap) => beatmap.HitObjects.Count
var maxCombo = GetMaxCombo(beatmap);
int maxTinyDroplets = beatmap.HitObjects.OfType<JuiceStream>().Sum(s => s.NestedHitObjects.OfType<TinyDroplet>().Count());
int maxDroplets = beatmap.HitObjects.OfType<JuiceStream>().Sum(s => s.NestedHitObjects.OfType<Droplet>().Count()) - maxTinyDroplets;
int maxFruits = beatmap.HitObjects.OfType<Fruit>().Count() + 2 * beatmap.HitObjects.OfType<JuiceStream>().Count() + beatmap.HitObjects.OfType<JuiceStream>().Sum(s => s.RepeatCount);
int maxFruits = beatmap.HitObjects.Sum(h => h is Fruit ? 1 : (h as JuiceStream)?.NestedHitObjects.Count(n => n is Fruit) ?? 0);

// Either given or max value minus misses
int countDroplets = countGood ?? Math.Max(0, maxDroplets - countMiss);
Expand Down

0 comments on commit cb9b280

Please sign in to comment.