Arbitrary smudge types

This commit is contained in:
Paul Chote
2010-04-08 18:44:20 +12:00
committed by Bob
parent 916706fa75
commit 05f28bca23
3 changed files with 9 additions and 16 deletions

View File

@@ -52,9 +52,12 @@ namespace OpenRA
Sound.Play(GetImpactSound(warhead, isWater));
if (warhead.SmudgeType != SmudgeType.None)
if (warhead.SmudgeType != null)
{
var smudgeLayer = world.WorldActor.traits.WithInterface<SmudgeLayer>().FirstOrDefault(x => x.Info.Type == warhead.SmudgeType);
if (smudgeLayer == null)
throw new NotImplementedException("Unknown smudge type `{0}`".F(warhead.SmudgeType));
if (!isWater)
smudgeLayer.AddSmudge(targetTile);
}