Pass the sequence name to the Corpse effect instead of an InfDeath number. Only play death animations for standard deaths.

This commit is contained in:
Paul Chote
2011-06-26 14:07:15 +12:00
parent 19ead53223
commit 7173d193cf
2 changed files with 7 additions and 4 deletions

View File

@@ -21,12 +21,12 @@ namespace OpenRA.Mods.RA.Effects
readonly float2 pos;
readonly string palette;
public Corpse(Actor fromActor, int death)
public Corpse(Actor fromActor, string sequence)
{
var rs = fromActor.Trait<RenderSimple>();
palette = rs.Palette(fromActor.Owner);
anim = new Animation(rs.GetImage(fromActor));
anim.PlayThen("die{0}".F(death + 1),
anim.PlayThen(sequence,
() => fromActor.World.AddFrameEndTask(w => w.Remove(this)));
pos = fromActor.CenterLocation;