Fix DeathSounds not working without DeathTypes defined

This commit is contained in:
abcdefg30
2015-12-04 22:06:16 +01:00
parent b45ae48c59
commit 642e213049

View File

@@ -41,11 +41,8 @@ namespace OpenRA.Mods.Common.Traits
{
var warhead = e.Warhead as DamageWarhead;
// Killed by some non-standard means
if (warhead == null)
return;
if (warhead.DamageTypes.Overlaps(info.DeathTypes))
// If the warhead is null, the actor was killed by some non-standard means
if (info.DeathTypes.Count == 0 || (warhead != null && warhead.DamageTypes.Overlaps(info.DeathTypes)))
self.PlayVoiceLocal(info.Voice, info.VolumeMultiplier);
}
}