mirror of
https://github.com/ppy/osu
synced 2025-02-21 13:07:18 +00:00
Allow Beatmap to populate some metadata defaults if they aren't provided via BetamapInfo
This commit is contained in:
parent
66afba6219
commit
12a9cbad56
@ -58,6 +58,23 @@ namespace osu.Game.Beatmaps
|
|||||||
ComboColors = original?.ComboColors ?? ComboColors;
|
ComboColors = original?.ComboColors ?? ComboColors;
|
||||||
HitObjects = original?.HitObjects ?? HitObjects;
|
HitObjects = original?.HitObjects ?? HitObjects;
|
||||||
Storyboard = original?.Storyboard ?? Storyboard;
|
Storyboard = original?.Storyboard ?? Storyboard;
|
||||||
|
|
||||||
|
if (original == null && Metadata == null)
|
||||||
|
{
|
||||||
|
// we may have no metadata in cases we weren't sourced from the database.
|
||||||
|
// let's fill it (and other related fields) so we don't need to null-check it in future usages.
|
||||||
|
BeatmapInfo = new BeatmapInfo
|
||||||
|
{
|
||||||
|
Metadata = new BeatmapMetadata
|
||||||
|
{
|
||||||
|
Artist = @"Unknown",
|
||||||
|
Title = @"Unknown",
|
||||||
|
Author = @"Unknown Creator",
|
||||||
|
},
|
||||||
|
Version = @"Normal",
|
||||||
|
Difficulty = new BeatmapDifficulty()
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user