rename RangeSquard to LengthSquared
This commit is contained in:
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
var d = self.CenterPosition - other.CenterPosition;
|
||||
var distSq = d.HorizontalLengthSquared;
|
||||
if (distSq > info.IdealSeparation.RangeSquared)
|
||||
if (distSq > info.IdealSeparation.LengthSquared)
|
||||
return WVec.Zero;
|
||||
|
||||
if (distSq < 1)
|
||||
|
||||
@@ -268,7 +268,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (modifiers.HasModifier(TargetModifiers.ForceAttack))
|
||||
{
|
||||
var targetRange = (self.World.Map.CenterOfCell(location) - self.CenterPosition).HorizontalLengthSquared;
|
||||
if (targetRange > ab.GetMaximumRange().RangeSquared)
|
||||
if (targetRange > ab.GetMaximumRange().LengthSquared)
|
||||
cursor = ab.Info.OutsideRangeCursor;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
var targetCell = self.World.Map.CellContaining(target.CenterPosition);
|
||||
if ((self.CenterPosition - target.CenterPosition).LengthSquared < transport.MinimumDistance.RangeSquared)
|
||||
if ((self.CenterPosition - target.CenterPosition).LengthSquared < transport.MinimumDistance.LengthSquared)
|
||||
return;
|
||||
|
||||
transport.RequestTransport(targetCell, nextActivity);
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public void UnitProducedByOther(Actor self, Actor producer, Actor produced)
|
||||
{
|
||||
// Work around for actors produced within the region not triggering until the second tick
|
||||
if ((produced.CenterPosition - self.CenterPosition).HorizontalLengthSquared <= info.Range.RangeSquared)
|
||||
if ((produced.CenterPosition - self.CenterPosition).HorizontalLengthSquared <= info.Range.LengthSquared)
|
||||
{
|
||||
var stance = self.Owner.Stances[produced.Owner];
|
||||
if (!info.ValidStances.HasFlag(stance))
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
// Select only the tiles that are within range from the requested SubCell
|
||||
// This assumes that the SubCell does not change during the path traversal
|
||||
var tilesInRange = world.Map.FindTilesInCircle(targetCell, range.Length / 1024 + 1)
|
||||
.Where(t => (world.Map.CenterOfCell(t) - target).LengthSquared <= range.RangeSquared
|
||||
.Where(t => (world.Map.CenterOfCell(t) - target).LengthSquared <= range.LengthSquared
|
||||
&& mi.CanEnterCell(self.World as World, self as Actor, t));
|
||||
|
||||
// See if there is any cell within range that does not involve a cross-domain request
|
||||
|
||||
Reference in New Issue
Block a user