Fix map StartingMusic overriding BackgroundMusic.

This commit is contained in:
Paul Chote
2015-10-18 09:56:12 +01:00
parent b14f5ca608
commit fb631367ea

View File

@@ -66,9 +66,7 @@ namespace OpenRA.Mods.Common.Traits
random = playlist.Shuffle(Game.CosmeticRandom).ToArray();
IsMusicAvailable = playlist.Any();
if (SongExists(info.StartingMusic))
currentSong = world.Map.Rules.Music[info.StartingMusic];
else if (SongExists(info.BackgroundMusic))
if (SongExists(info.BackgroundMusic))
{
currentSong = currentBackgroundSong = world.Map.Rules.Music[info.BackgroundMusic];
CurrentSongIsBackground = true;
@@ -81,6 +79,12 @@ namespace OpenRA.Mods.Common.Traits
currentSong = random.FirstOrDefault();
}
if (SongExists(info.StartingMusic))
{
currentSong = world.Map.Rules.Music[info.StartingMusic];
CurrentSongIsBackground = false;
}
Play();
}