diff --git a/OpenRA.Mods.Common/Scripting/Properties/CombatProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/CombatProperties.cs index 875720bec3..5448db344e 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/CombatProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/CombatProperties.cs @@ -78,12 +78,12 @@ namespace OpenRA.Mods.Common.Scripting [ScriptPropertyGroup("Combat")] public class GeneralCombatProperties : ScriptActorProperties, Requires { - readonly AttackBase attackBase; + readonly AttackBase[] attackBases; public GeneralCombatProperties(ScriptContext context, Actor self) : base(context, self) { - attackBase = self.Trait(); + attackBases = self.TraitsImplementing().ToArray(); } [Desc("Attack the target actor. The target actor needs to be visible.")] @@ -96,7 +96,8 @@ namespace OpenRA.Mods.Common.Scripting if (!targetActor.Info.HasTraitInfo() && !targetActor.CanBeViewedByPlayer(Self.Owner)) Log.Write("lua", "{1} is not revealed for player {0}!", Self.Owner, targetActor); - attackBase.AttackTarget(target, true, allowMove, forceAttack); + foreach (var attack in attackBases) + attack.AttackTarget(target, true, allowMove, forceAttack); } [Desc("Checks if the targeted actor is a valid target for this actor.")]