don't offer an attack cursor on things we can't attack

This commit is contained in:
Chris Forbes
2009-12-31 16:46:53 +13:00
parent 4a52a38d0f
commit 98f643dc66

View File

@@ -57,8 +57,12 @@ namespace OpenRa.Game
public static bool WeaponValidForTarget(WeaponInfo weapon, Actor target)
{
var projectile = Rules.ProjectileInfo[weapon.Projectile];
var warhead = Rules.WarheadInfo[weapon.Warhead];
var unit = target.traits.GetOrDefault<Unit>();
if (warhead.EffectivenessAgainst(target.Info.Armor) <= 0)
return false;
if (target.traits.Contains<Submarine>())
return projectile.ASW;