Add AttackGarrisoned for allowing passengers to shoot outside. Fixes #4483.

This commit is contained in:
Paul Chote
2014-03-17 17:41:45 +13:00
parent d7d00fffef
commit 387a5ded4b
5 changed files with 213 additions and 8 deletions

View File

@@ -135,7 +135,13 @@ namespace OpenRA.Mods.RA
public abstract Activity GetAttackActivity(Actor self, Target newTarget, bool allowMove);
public bool HasAnyValidWeapons(Target t) { return Armaments.Any(a => a.Weapon.IsValidAgainst(t, self.World)); }
public WRange GetMaximumRange() { return Armaments.Max(a => a.Weapon.Range); }
public WRange GetMaximumRange()
{
if (!Armaments.Any())
return WRange.Zero;
return Armaments.Max(a => a.Weapon.Range);
}
public Armament ChooseArmamentForTarget(Target t) { return Armaments.FirstOrDefault(a => a.Weapon.IsValidAgainst(t, self.World)); }