more porting

This commit is contained in:
Chris Forbes
2010-01-10 19:25:16 +13:00
parent e131963c53
commit 356b7dae7a
4 changed files with 13 additions and 19 deletions

View File

@@ -142,5 +142,13 @@ namespace OpenRa.Game.Traits
return acts.Reverse().Aggregate(
(next, a) => { a.NextActivity = next; return a; });
}
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);
}
}
}