more ported bits

This commit is contained in:
Chris Forbes
2010-01-10 19:11:58 +13:00
parent e7f9023aca
commit 8e944871fa
11 changed files with 51 additions and 21 deletions

View File

@@ -15,7 +15,8 @@ namespace OpenRa.Game.Traits
float GetMaximumRange(Actor self)
{
return new[] { self.LegacyInfo.Primary, self.LegacyInfo.Secondary }
var info = self.Info.Traits.WithInterface<AttackBaseInfo>().First();
return new[] { info.PrimaryWeapon, info.SecondaryWeapon }
.Where(w => w != null)
.Max(w => Rules.WeaponInfo[w].Range);
}