rename WRange to WDist
This commit is contained in:
@@ -162,23 +162,23 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return Armaments.Any(a => a.Weapon.IsValidAgainst(t, self.World, self));
|
||||
}
|
||||
|
||||
public WRange GetMinimumRange()
|
||||
public WDist GetMinimumRange()
|
||||
{
|
||||
if (IsTraitDisabled)
|
||||
return WRange.Zero;
|
||||
return WDist.Zero;
|
||||
|
||||
return Armaments.Where(a => !a.IsTraitDisabled)
|
||||
.Select(a => a.Weapon.MinRange).Min();
|
||||
}
|
||||
|
||||
public WRange GetMaximumRange()
|
||||
public WDist GetMaximumRange()
|
||||
{
|
||||
if (IsTraitDisabled)
|
||||
return WRange.Zero;
|
||||
return WDist.Zero;
|
||||
|
||||
return Armaments.Where(a => !a.IsTraitDisabled)
|
||||
.Select(a => a.Weapon.Range)
|
||||
.Append(WRange.Zero).Max();
|
||||
.Append(WDist.Zero).Max();
|
||||
}
|
||||
|
||||
public Armament ChooseArmamentForTarget(Target t) { return Armaments.FirstOrDefault(a => a.Weapon.IsValidAgainst(t, self.World, self)); }
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|| (target.Type == TargetType.FrozenActor && target.FrozenActor.Info.Traits.Contains<IMove>());
|
||||
|
||||
// Try and sit at least one cell closer than the max range to give some leeway if the target starts moving.
|
||||
var maxRange = targetIsMobile ? new WRange(Math.Max(weapon.Weapon.MinRange.Range, weapon.Weapon.Range.Range - 1024))
|
||||
var maxRange = targetIsMobile ? new WDist(Math.Max(weapon.Weapon.MinRange.Range, weapon.Weapon.Range.Range - 1024))
|
||||
: weapon.Weapon.Range;
|
||||
|
||||
attack.Target = target;
|
||||
|
||||
Reference in New Issue
Block a user