remove some insanity in DrawLineToTarget
This commit is contained in:
@@ -57,13 +57,17 @@ namespace OpenRA.Traits
|
||||
if (!target.IsValid)
|
||||
return;
|
||||
|
||||
var p = target.CenterLocation;
|
||||
var move = self.TraitOrDefault<IMove>();
|
||||
var origin = move != null ? self.CenterLocation - new int2(0, move.Altitude) : self.CenterLocation;
|
||||
|
||||
var wlr = Game.Renderer.WorldLineRenderer;
|
||||
wlr.DrawLine(origin, p, c, c);
|
||||
for (bool b = false; !b; p = origin, b = true)
|
||||
|
||||
wlr.DrawLine(origin, target.CenterLocation, c, c);
|
||||
DrawTargetMarker(wlr, target.CenterLocation);
|
||||
DrawTargetMarker(wlr, origin);
|
||||
}
|
||||
|
||||
void DrawTargetMarker(LineRenderer wlr, float2 p)
|
||||
{
|
||||
wlr.DrawLine(p + new float2(-1, -1), p + new float2(-1, 1), c, c);
|
||||
wlr.DrawLine(p + new float2(-1, 1), p + new float2(1, 1), c, c);
|
||||
@@ -71,7 +75,6 @@ namespace OpenRA.Traits
|
||||
wlr.DrawLine(p + new float2(1, -1), p + new float2(-1, -1), c, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class LineTargetExts
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user