Skip to content

Commit

Permalink
Merge pull request #200 from MaxOhn/catch-hitresults
Browse files Browse the repository at this point in the history
Fix maxFruits count
  • Loading branch information
smoogipoo authored Mar 4, 2024
2 parents 64a3f17 + cb9b280 commit c3cbe41
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 Dictionary<HitResult, int> GenerateHitResults(double accuracy
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 c3cbe41

Please sign in to comment.