Remove passing the warheads from DamageWarhead to AttackInfo.
Added a Damage class to pass damage value and damage(types) instead. This removes a great amount of overhead and longterm opens possibilities to have damagetypes without warheads.
This commit is contained in:
@@ -39,11 +39,8 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
||||
|
||||
public void Killed(Actor self, AttackInfo e)
|
||||
{
|
||||
var warhead = e.Warhead as DamageWarhead;
|
||||
|
||||
// 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)))
|
||||
if (info.DeathTypes.Count == 0 || e.Damage.DamageTypes.Overlaps(info.DeathTypes))
|
||||
self.PlayVoiceLocal(info.Voice, info.VolumeMultiplier);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user