some accessors

This commit is contained in:
Chris Forbes
2010-01-11 21:59:32 +13:00
parent e7a99541e5
commit 10a5b40e16
5 changed files with 34 additions and 15 deletions

View File

@@ -146,9 +146,8 @@ namespace OpenRa.Game.Traits
public static float GetMaximumRange(Actor self)
{
var info = self.Info.Traits.WithInterface<AttackBaseInfo>().First();
return new[] { info.PrimaryWeapon, info.SecondaryWeapon }
.Where(w => w != null)
.Max(w => Rules.WeaponInfo[w].Range);
return new[] { self.GetPrimaryWeapon(), self.GetSecondaryWeapon() }
.Where(w => w != null).Max(w => w.Range);
}
}
}