don't offer an attack cursor on things we can't attack
This commit is contained in:
@@ -57,8 +57,12 @@ namespace OpenRa.Game
|
|||||||
public static bool WeaponValidForTarget(WeaponInfo weapon, Actor target)
|
public static bool WeaponValidForTarget(WeaponInfo weapon, Actor target)
|
||||||
{
|
{
|
||||||
var projectile = Rules.ProjectileInfo[weapon.Projectile];
|
var projectile = Rules.ProjectileInfo[weapon.Projectile];
|
||||||
|
var warhead = Rules.WarheadInfo[weapon.Warhead];
|
||||||
var unit = target.traits.GetOrDefault<Unit>();
|
var unit = target.traits.GetOrDefault<Unit>();
|
||||||
|
|
||||||
|
if (warhead.EffectivenessAgainst(target.Info.Armor) <= 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (target.traits.Contains<Submarine>())
|
if (target.traits.Contains<Submarine>())
|
||||||
return projectile.ASW;
|
return projectile.ASW;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user