diff --git a/OpenRA.Game/Graphics/Animation.cs b/OpenRA.Game/Graphics/Animation.cs index a1d0c0b03b..78609531b8 100644 --- a/OpenRA.Game/Graphics/Animation.cs +++ b/OpenRA.Game/Graphics/Animation.cs @@ -22,6 +22,7 @@ namespace OpenRA.Graphics public string Name { get; private set; } public bool IsDecoration { get; set; } + readonly Map map; readonly SequenceSet sequences; readonly Func facingFunc; readonly Func paused; @@ -43,6 +44,7 @@ namespace OpenRA.Graphics public Animation(World world, string name, Func facingFunc, Func paused) { + map = world.Map; sequences = world.Map.Sequences; Name = name.ToLowerInvariant(); this.facingFunc = facingFunc; @@ -65,8 +67,10 @@ namespace OpenRA.Graphics var shadow = CurrentSequence.GetShadow(CurrentFrame, facingFunc()); if (shadow != null) { + var height = map.DistanceAboveTerrain(pos).Length; + var shadowRenderable = new SpriteRenderable( - shadow, pos, offset, CurrentSequence.ShadowZOffset + zOffset, palette, + shadow, pos, offset - new WVec(0, 0, height), CurrentSequence.ShadowZOffset + zOffset + height, palette, CurrentSequence.Scale, 1f, float3.Ones, tintModifiers, true, rotation); return new IRenderable[] { shadowRenderable, imageRenderable };