From 19ddb61d18b929150aedcca784573bc9bd9b9315 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 4 Dec 2013 10:23:05 +1300 Subject: [PATCH] Don't show make animations for starting actors. --- OpenRA.Mods.D2k/Render/WithCrumbleOverlay.cs | 18 ++++++++++-------- OpenRA.Mods.RA/SpawnMPUnits.cs | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/OpenRA.Mods.D2k/Render/WithCrumbleOverlay.cs b/OpenRA.Mods.D2k/Render/WithCrumbleOverlay.cs index 709bfe6e48..2976fd4426 100644 --- a/OpenRA.Mods.D2k/Render/WithCrumbleOverlay.cs +++ b/OpenRA.Mods.D2k/Render/WithCrumbleOverlay.cs @@ -19,22 +19,24 @@ namespace OpenRA.Mods.RA.Render [Desc("Sequence name to use")] public readonly string Sequence = "crumble-overlay"; - public object Create(ActorInitializer init) { return new WithCrumbleOverlay(init.self, this); } + public object Create(ActorInitializer init) { return new WithCrumbleOverlay(init, this); } } public class WithCrumbleOverlay : INotifyBuildComplete { - Animation overlay; bool buildComplete = false; - public WithCrumbleOverlay(Actor self, WithCrumbleOverlayInfo info) + public WithCrumbleOverlay(ActorInitializer init, WithCrumbleOverlayInfo info) { - var rs = self.Trait(); + var rs = init.self.Trait(); - overlay = new Animation(rs.GetImage(self)); - overlay.PlayThen(info.Sequence, () => buildComplete = false); - rs.anims.Add("make_overlay_{0}".F(info.Sequence), - new AnimationWithOffset(overlay, null, () => !buildComplete, null)); + if (!init.Contains()) + { + var overlay = new Animation(rs.GetImage(init.self)); + overlay.PlayThen(info.Sequence, () => buildComplete = false); + rs.anims.Add("make_overlay_{0}".F(info.Sequence), + new AnimationWithOffset(overlay, null, () => !buildComplete, null)); + } } public void BuildingComplete(Actor self) diff --git a/OpenRA.Mods.RA/SpawnMPUnits.cs b/OpenRA.Mods.RA/SpawnMPUnits.cs index e824df78a6..a28cdd0770 100644 --- a/OpenRA.Mods.RA/SpawnMPUnits.cs +++ b/OpenRA.Mods.RA/SpawnMPUnits.cs @@ -45,6 +45,7 @@ namespace OpenRA.Mods.RA { new LocationInit(sp), new OwnerInit(p), + new SkipMakeAnimsInit(), }); }