Add Sound.Play overloads that play a random sound from a list
This commit is contained in:
@@ -222,7 +222,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
if (Info.DeploySounds != null && Info.DeploySounds.Any())
|
||||
Game.Sound.Play(SoundType.World, Info.DeploySounds.Random(self.World.LocalRandom), self.CenterPosition);
|
||||
Game.Sound.Play(SoundType.World, Info.DeploySounds, self.World, self.CenterPosition);
|
||||
|
||||
// Revoke condition that is applied while undeployed.
|
||||
if (!init)
|
||||
@@ -246,7 +246,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
if (Info.UndeploySounds != null && Info.UndeploySounds.Any())
|
||||
Game.Sound.Play(SoundType.World, Info.UndeploySounds.Random(self.World.LocalRandom), self.CenterPosition);
|
||||
Game.Sound.Play(SoundType.World, Info.UndeploySounds, self.World, self.CenterPosition);
|
||||
|
||||
if (!init)
|
||||
OnUndeployStarted();
|
||||
|
||||
Reference in New Issue
Block a user