Extract actor voice set into Voiced trait

This commit is contained in:
reaperrr
2015-04-20 22:24:53 +02:00
parent 66f99704a8
commit 0d05fdefbb
23 changed files with 223 additions and 108 deletions

View File

@@ -57,9 +57,9 @@ namespace OpenRA
}
}
var voicedUnit = actors.FirstOrDefault(a => a.Owner == world.LocalPlayer && a.IsInWorld && a.HasVoices());
if (voicedUnit != null)
Sound.PlayVoice("Select", voicedUnit, voicedUnit.Owner.Country.Race);
var voicedActor = actors.FirstOrDefault(a => a.Owner == world.LocalPlayer && a.IsInWorld && a.HasVoices());
if (voicedActor != null)
Sound.PlayVoice("Select", voicedActor, voicedActor.Owner.Country.Race);
foreach (var a in newSelection)
foreach (var sel in a.TraitsImplementing<INotifySelected>())