non-turreted AutoTarget is sensible now

This commit is contained in:
Chris Forbes
2009-12-28 12:08:56 +13:00
parent 73864861e5
commit d3767f2d99
7 changed files with 31 additions and 18 deletions

View File

@@ -106,19 +106,18 @@ namespace OpenRa.Game
.FirstOrDefault( x => x != null );
}
public RectangleF Bounds
public RectangleF GetBounds(bool useAltitude)
{
get
var size = SelectedSize;
var loc = CenterLocation - 0.5f * size;
if (useAltitude)
{
var size = SelectedSize;
var loc = CenterLocation - 0.5f * size;
var unit = traits.GetOrDefault<Unit>();
if (unit != null)
loc -= new float2(0, unit.Altitude);
return new RectangleF(loc.X, loc.Y, size.X, size.Y);
if (unit != null) loc -= new float2(0, unit.Altitude);
}
return new RectangleF(loc.X, loc.Y, size.X, size.Y);
}
public bool IsDead { get { return Health <= 0; } }