mirror of
https://github.com/ppy/osu.git
synced 2024-11-14 17:17:24 +08:00
Merge pull request #20826 from peppy/fix-missing-beatmap-backgrounds
Fix some older beatmaps having missing backgrounds
This commit is contained in:
commit
fd7274095f
@ -355,6 +355,14 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
case LegacyEventType.Sprite:
|
||||||
|
// Generally, the background is the first thing defined in a beatmap file.
|
||||||
|
// In some older beatmaps, it is not present and replaced by a storyboard-level background instead.
|
||||||
|
// Allow the first sprite (by file order) to act as the background in such cases.
|
||||||
|
if (string.IsNullOrEmpty(beatmap.BeatmapInfo.Metadata.BackgroundFile))
|
||||||
|
beatmap.BeatmapInfo.Metadata.BackgroundFile = CleanFilename(split[3]);
|
||||||
|
break;
|
||||||
|
|
||||||
case LegacyEventType.Background:
|
case LegacyEventType.Background:
|
||||||
beatmap.BeatmapInfo.Metadata.BackgroundFile = CleanFilename(split[2]);
|
beatmap.BeatmapInfo.Metadata.BackgroundFile = CleanFilename(split[2]);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user