Make helicopters move backwards when target is too close

'Too close' as in closer than weapons' MinRange.
This commit is contained in:
reaperrr
2015-04-08 00:31:40 +02:00
parent a37babf0c1
commit 7ddd6aab93
2 changed files with 22 additions and 0 deletions

View File

@@ -157,6 +157,15 @@ namespace OpenRA.Mods.Common.Traits
return Armaments.Any(a => a.Weapon.IsValidAgainst(t, self.World, self));
}
public WRange GetMinimumRange()
{
if (IsTraitDisabled)
return WRange.Zero;
return Armaments.Where(a => !a.IsTraitDisabled)
.Select(a => a.Weapon.MinRange).Min();
}
public WRange GetMaximumRange()
{
if (IsTraitDisabled)