From 65a7f2e863cfd72c83003a3a81371480ae84c713 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 16 Nov 2015 20:39:06 +0000 Subject: [PATCH] Restore earlier spy targeting behaviour. --- OpenRA.Mods.Common/Traits/Attack/AttackBase.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs b/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs index 1fb15f0185..b283073352 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs @@ -286,6 +286,14 @@ namespace OpenRA.Mods.Common.Traits if (modifiers.HasModifier(TargetModifiers.ForceMove)) return false; + // Disguised actors are revealed by the attack cursor + // HACK: works around limitations in the targeting code that force the + // targeting and attacking logic (which should be logically separate) + // to use the same code + if (target.Type == TargetType.Actor && target.Actor.EffectiveOwner != null && + target.Actor.EffectiveOwner.Disguised && self.Owner.Stances[target.Actor.Owner] == Stance.Enemy) + modifiers |= TargetModifiers.ForceAttack; + var forceAttack = modifiers.HasModifier(TargetModifiers.ForceAttack); var a = ab.ChooseArmamentsForTarget(target, forceAttack).FirstOrDefault(); if (a == null)