From 6420a6ec8aa4d7a250a39793555d477a5523b401 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Sat, 24 Oct 2015 00:27:23 +0200 Subject: [PATCH] Allow force-attacking things with the Lua API's Attack() method --- OpenRA.Mods.Common/Scripting/Properties/CombatProperties.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Scripting/Properties/CombatProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/CombatProperties.cs index f7f93a977d..cdfaac470c 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/CombatProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/CombatProperties.cs @@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Scripting } [Desc("Attack the target actor. The target actor needs to be visible.")] - public void Attack(Actor targetActor, bool allowMove = true) + public void Attack(Actor targetActor, bool allowMove = true, bool forceAttack = false) { var target = Target.FromActor(targetActor); if (!target.IsValidFor(Self) || target.Type == TargetType.FrozenActor) @@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Scripting if (!targetActor.Info.HasTraitInfo() && !Self.Owner.CanTargetActor(targetActor)) Log.Write("lua", "{1} is not revealed for player {0}!", Self.Owner, targetActor); - attackBase.AttackTarget(target, true, allowMove); + attackBase.AttackTarget(target, true, allowMove, forceAttack); } } }