diff --git a/OpenRA.Mods.RA/AI/SupportPowerDecision.cs b/OpenRA.Mods.RA/AI/SupportPowerDecision.cs index 5eacf869e1..f884e76cd8 100644 --- a/OpenRA.Mods.RA/AI/SupportPowerDecision.cs +++ b/OpenRA.Mods.RA/AI/SupportPowerDecision.cs @@ -74,7 +74,7 @@ namespace OpenRA.Mods.RA var checkActors = world.FindActorsInCircle(pos, radiusToUse); foreach (var scrutinized in checkActors) - answer += consideration.GetAttractiveness(scrutinized, firedBy.Stances[scrutinized.Owner]); + answer += consideration.GetAttractiveness(scrutinized, firedBy.Stances[scrutinized.Owner], firedBy); } return answer; @@ -87,7 +87,7 @@ namespace OpenRA.Mods.RA foreach (var consideration in Considerations) foreach (var scrutinized in actors) - answer += consideration.GetAttractiveness(scrutinized, firedBy.Stances[scrutinized.Owner]); + answer += consideration.GetAttractiveness(scrutinized, firedBy.Stances[scrutinized.Owner], firedBy); return answer; } @@ -120,7 +120,7 @@ namespace OpenRA.Mods.RA } ///Evaluates a single actor according to the rules defined in this consideration - public int GetAttractiveness(Actor a, Stance stance) + public int GetAttractiveness(Actor a, Stance stance, Player firedBy) { if (stance != Against) return 0; @@ -132,6 +132,9 @@ namespace OpenRA.Mods.RA if (targetable == null) return 0; + if (!targetable.TargetableBy(a, firedBy.PlayerActor)) + return 0; + if (Types.Intersect(targetable.TargetTypes).Any()) { switch (TargetMetric)