1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 16:10:24 +08:00

Fix unnecessary null check and dangling delegate

This commit is contained in:
jkh675
2025-01-09 14:46:27 +08:00
Unverified
parent 7363d1a880
commit 9002e540ab
2 changed files with 12 additions and 2 deletions
@@ -51,6 +51,16 @@ namespace osu.Game.Rulesets.Osu.Skinning
scoreProcessor.NewJudgement += updateHeatmap;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
if (gameplayClockContainer != null)
gameplayClockContainer.OnSeek -= initHeatmap;
scoreProcessor.NewJudgement -= updateHeatmap;
}
private void initHeatmap()
{
ScoreInfo scoreInfo = new ScoreInfo { BeatmapInfo = beatmap.Value.BeatmapInfo, HitEvents = (List<HitEvent>)scoreProcessor.HitEvents };
@@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Osu.Statistics
private const float rotation = 45;
private BufferedContainer bufferedGrid = null!;
private GridContainer? pointGrid;
private GridContainer pointGrid = null!;
private readonly ScoreInfo score;
private readonly IBeatmap playableBeatmap;
@@ -234,7 +234,7 @@ namespace osu.Game.Rulesets.Osu.Statistics
public void AddPoint(Vector2 start, Vector2 end, Vector2 hitPoint, float radius)
{
if (pointGrid == null || pointGrid.Content.Count == 0)
if (pointGrid.Content.Count == 0)
return;
double angle1 = Math.Atan2(end.Y - hitPoint.Y, hitPoint.X - end.X); // Angle between the end point and the hit point.