Merge pull request #9666 from pchote/fix-startingmusic-clash
Fix map StartingMusic overriding BackgroundMusic initialization.
This commit is contained in:
@@ -66,9 +66,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
random = playlist.Shuffle(Game.CosmeticRandom).ToArray();
|
random = playlist.Shuffle(Game.CosmeticRandom).ToArray();
|
||||||
IsMusicAvailable = playlist.Any();
|
IsMusicAvailable = playlist.Any();
|
||||||
|
|
||||||
if (SongExists(info.StartingMusic))
|
if (SongExists(info.BackgroundMusic))
|
||||||
currentSong = world.Map.Rules.Music[info.StartingMusic];
|
|
||||||
else if (SongExists(info.BackgroundMusic))
|
|
||||||
{
|
{
|
||||||
currentSong = currentBackgroundSong = world.Map.Rules.Music[info.BackgroundMusic];
|
currentSong = currentBackgroundSong = world.Map.Rules.Music[info.BackgroundMusic];
|
||||||
CurrentSongIsBackground = true;
|
CurrentSongIsBackground = true;
|
||||||
@@ -81,6 +79,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
currentSong = random.FirstOrDefault();
|
currentSong = random.FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SongExists(info.StartingMusic))
|
||||||
|
{
|
||||||
|
currentSong = world.Map.Rules.Music[info.StartingMusic];
|
||||||
|
CurrentSongIsBackground = false;
|
||||||
|
}
|
||||||
|
|
||||||
Play();
|
Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user