Move PlayVoice and PlayVoiceLocal from Sound to Voiced.

Move HasVoice, HasVoices and GetVoices from WorldUtils to Voiced.
This commit is contained in:
reaperrr
2015-05-12 16:35:31 +02:00
parent 037bd6794c
commit 251d3e6864
9 changed files with 77 additions and 61 deletions

View File

@@ -42,9 +42,11 @@ namespace OpenRA.Mods.Common.Traits
var cp = self.CenterPosition;
if (info.DeathTypes.Contains(e.Warhead.DeathType) ||
(!info.DeathTypes.Any() && !self.Info.Traits.WithInterface<DeathSoundsInfo>().Any(dsi => dsi.DeathTypes.Contains(e.Warhead.DeathType))))
Sound.PlayVoiceLocal(info.DeathSound, self, self.Owner.Country.Race, cp, info.VolumeMultiplier);
foreach (var voiced in self.TraitsImplementing<IVoiced>())
if (info.DeathTypes.Contains(e.Warhead.DeathType) ||
(!info.DeathTypes.Any() && !self.Info.Traits.WithInterface<DeathSoundsInfo>()
.Any(dsi => dsi.DeathTypes.Contains(e.Warhead.DeathType))))
voiced.PlayVoiceLocal(info.DeathSound, self, self.Owner.Country.Race, cp, info.VolumeMultiplier);
}
}
}