Make AttackBase.GetMinimumRange() return WDist.Zero if there are no available armaments
This commit is contained in:
@@ -167,8 +167,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (IsTraitDisabled)
|
if (IsTraitDisabled)
|
||||||
return WDist.Zero;
|
return WDist.Zero;
|
||||||
|
|
||||||
return Armaments.Where(a => !a.IsTraitDisabled)
|
var min = Armaments.Where(a => !a.IsTraitDisabled)
|
||||||
.Select(a => a.Weapon.MinRange).Min();
|
.Select(a => a.Weapon.MinRange)
|
||||||
|
.Append(WDist.MaxValue).Min();
|
||||||
|
return min != WDist.MaxValue ? min : WDist.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WDist GetMaximumRange()
|
public WDist GetMaximumRange()
|
||||||
|
|||||||
Reference in New Issue
Block a user