Remove Actor.HasTrait<T>()

This commit is contained in:
atlimit8
2015-08-01 23:53:58 -05:00
parent 959914779f
commit 85fab45451
79 changed files with 153 additions and 153 deletions

View File

@@ -202,7 +202,7 @@ namespace OpenRA.Mods.Common.Traits
public bool IsReachableTarget(Target target, bool allowMove)
{
return HasAnyValidWeapons(target)
&& (target.IsInRange(self.CenterPosition, GetMaximumRange()) || (allowMove && self.HasTrait<IMove>()));
&& (target.IsInRange(self.CenterPosition, GetMaximumRange()) || (allowMove && self.Info.Traits.Contains<IMoveInfo>()));
}
class AttackOrderTargeter : IOrderTargeter

View File

@@ -81,8 +81,8 @@ namespace OpenRA.Mods.Common.Traits
var weapon = attack.ChooseArmamentForTarget(target);
if (weapon != null)
{
var targetIsMobile = (target.Type == TargetType.Actor && target.Actor.HasTrait<IMove>())
|| (target.Type == TargetType.FrozenActor && target.FrozenActor.Info.Traits.Contains<IMove>());
var targetIsMobile = (target.Type == TargetType.Actor && target.Actor.Info.Traits.Contains<IMoveInfo>())
|| (target.Type == TargetType.FrozenActor && target.FrozenActor.Info.Traits.Contains<IMoveInfo>());
// 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 WDist(Math.Max(weapon.Weapon.MinRange.Length, weapon.Weapon.Range.Length - 1024))