diff --git a/OpenRA.Game/Graphics/WorldRenderer.cs b/OpenRA.Game/Graphics/WorldRenderer.cs index 545c9a1abc..05c6a7ebc4 100644 --- a/OpenRA.Game/Graphics/WorldRenderer.cs +++ b/OpenRA.Game/Graphics/WorldRenderer.cs @@ -239,19 +239,22 @@ namespace OpenRA.Graphics var mobile = selectedUnit.traits.WithInterface().FirstOrDefault(); if (mobile != null) { + var unit = selectedUnit.traits.Get(); + var alt = (unit != null)? new float2(0, -unit.Altitude) : float2.Zero; var path = mobile.GetCurrentPath(selectedUnit); - var start = selectedUnit.CenterLocation; + var start = selectedUnit.CenterLocation + alt; var c = Color.Green; foreach (var step in path) { - lineRenderer.DrawLine(step + new float2(-1, -1), step + new float2(-1, 1), c, c); - lineRenderer.DrawLine(step + new float2(-1, 1), step + new float2(1, 1), c, c); - lineRenderer.DrawLine(step + new float2(1, 1), step + new float2(1, -1), c, c); - lineRenderer.DrawLine(step + new float2(1, -1), step + new float2(-1, -1), c, c); - lineRenderer.DrawLine(start, step, c, c); - start = step; + var stp = step + alt; + DrawLine(stp + new float2(-1, -1), stp + new float2(-1, 1), c, c); + DrawLine(stp + new float2(-1, 1), stp + new float2(1, 1), c, c); + DrawLine(stp + new float2(1, 1), stp + new float2(1, -1), c, c); + DrawLine(stp + new float2(1, -1), stp + new float2(-1, -1), c, c); + DrawLine(start, stp, c, c); + start = stp; } } }