From eaa9b49793d2a234fa11e08e6b2ddc6ff96b78a2 Mon Sep 17 00:00:00 2001 From: Mustafa Alperen Seki Date: Tue, 1 Jan 2019 17:46:51 +0300 Subject: [PATCH] Add Stance Support to GrantExternalConditionPower. --- .../Traits/SupportPowers/GrantExternalConditionPower.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs index db744be692..5583c93988 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs @@ -34,6 +34,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Sound to instantly play at the targeted area.")] public readonly string OnFireSound = null; + [Desc("Player stances which condition can be applied to.")] + public readonly Stance ValidStances = Stance.Ally; + [SequenceReference, Desc("Sequence to play for granting actor when activated.", "This requires the actor to have the WithSpriteBody trait or one of its derivatives.")] public readonly string Sequence = "active"; @@ -90,7 +93,7 @@ namespace OpenRA.Mods.Common.Traits return units.Distinct().Where(a => { - if (!a.Owner.IsAlliedWith(Self.Owner)) + if (!info.ValidStances.HasStance(a.Owner.Stances[Self.Owner])) return false; return a.TraitsImplementing()