Adds PlayVoice, PlayVoiceLocal and HasVoice to ActorExts.

Makes Cargo unload voice customisable.
This commit is contained in:
reaperrr
2015-05-21 05:35:08 +02:00
parent 5f68516070
commit 5e2c781c8a
5 changed files with 41 additions and 8 deletions

View File

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