diff --git a/OpenRA.Mods.Common/Traits/Render/WithShadow.cs b/OpenRA.Mods.Common/Traits/Render/WithShadow.cs index 4ca045b587..eae5ab05e0 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithShadow.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithShadow.cs @@ -35,11 +35,12 @@ namespace OpenRA.Mods.Common.Traits public IEnumerable ModifyRender(Actor self, WorldRenderer wr, IEnumerable r) { // Contrails shouldn't cast shadows + var height = self.World.Map.DistanceAboveTerrain(self.CenterPosition).Length; var shadowSprites = r.Where(s => !s.IsDecoration) .Select(a => a.WithPalette(wr.Palette(info.Palette)) - .OffsetBy(new WVec(0, 0, -a.Pos.Z)) - .WithZOffset(a.ZOffset + a.Pos.Z) - .AsDecoration()); + .OffsetBy(new WVec(0, 0, -height)) + .WithZOffset(a.ZOffset + height) + .AsDecoration()); return shadowSprites.Concat(r); }