1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Mark the CreateBeatmapProcessor() as nullable.

Also, should add the null check in the working beatmap.
This commit is contained in:
為什麼 2022-07-10 10:07:09 +08:00
parent d39f53f1f0
commit 57c6763556
2 changed files with 8 additions and 5 deletions

View File

@ -279,12 +279,15 @@ namespace osu.Game.Beatmaps
}
}
IBeatmapProcessor processor = rulesetInstance.CreateBeatmapProcessor(converted);
var processor = rulesetInstance.CreateBeatmapProcessor(converted);
foreach (var mod in mods.OfType<IApplicableToBeatmapProcessor>())
mod.ApplyToBeatmapProcessor(processor);
if (processor != null)
{
foreach (var mod in mods.OfType<IApplicableToBeatmapProcessor>())
mod.ApplyToBeatmapProcessor(processor);
processor?.PreProcess();
processor.PreProcess();
}
// Compute default values for hitobjects, including creating nested hitobjects in-case they're needed
foreach (var obj in converted.HitObjects)

View File

@ -226,7 +226,7 @@ namespace osu.Game.Rulesets
/// </summary>
/// <param name="beatmap">The <see cref="IBeatmap"/> to be processed.</param>
/// <returns>The <see cref="IBeatmapProcessor"/>.</returns>
public virtual IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => null;
public virtual IBeatmapProcessor? CreateBeatmapProcessor(IBeatmap beatmap) => null;
public abstract DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap beatmap);