From 4a671046037286ca68e8b86706b73bcc04cb05a8 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sat, 23 Jan 2016 13:21:29 +0100 Subject: [PATCH 1/2] Fix crates not showing their water animation when they are not paradropped. --- .../Traits/Render/WithCrateBody.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs b/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs index cdaa033580..57f072bdc0 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs @@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits } } - class WithCrateBody : INotifyParachuteLanded + class WithCrateBody : INotifyParachuteLanded, INotifyAddedToWorld { readonly Actor self; readonly Animation anim; @@ -57,7 +57,21 @@ namespace OpenRA.Mods.Common.Traits rs.Add(anim); } + void INotifyAddedToWorld.AddedToWorld(Actor self) + { + // Don't change animations while still in air + if (!self.IsAtGroundLevel()) + return; + + PlaySequence(); + } + public void OnLanded() + { + PlaySequence(); + } + + void PlaySequence() { var sequence = self.World.Map.GetTerrainInfo(self.Location).IsWater ? info.WaterSequence : info.LandSequence; if (!string.IsNullOrEmpty(sequence)) From b1fac69b012bf9ba939a17edf47e9755b22a62b3 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sat, 23 Jan 2016 13:22:11 +0100 Subject: [PATCH 2/2] Make the INotifyParachuteLanded implementation in WithCrateBody.cs explicit --- OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs b/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs index 57f072bdc0..45cdc4e63c 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs @@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Traits PlaySequence(); } - public void OnLanded() + void INotifyParachuteLanded.OnLanded() { PlaySequence(); }