Merge pull request #9736 from obrakmann/fix9693_lua-attack-broken
Fix broken scripted attacks in some missions
This commit is contained in:
@@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Desc("Attack the target actor. The target actor needs to be visible.")]
|
[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);
|
var target = Target.FromActor(targetActor);
|
||||||
if (!target.IsValidFor(Self) || target.Type == TargetType.FrozenActor)
|
if (!target.IsValidFor(Self) || target.Type == TargetType.FrozenActor)
|
||||||
@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
if (!targetActor.Info.HasTraitInfo<FrozenUnderFogInfo>() && !Self.Owner.CanTargetActor(targetActor))
|
if (!targetActor.Info.HasTraitInfo<FrozenUnderFogInfo>() && !Self.Owner.CanTargetActor(targetActor))
|
||||||
Log.Write("lua", "{1} is not revealed for player {0}!", Self.Owner, 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,9 +91,9 @@ WorldLoaded = function()
|
|||||||
|
|
||||||
-- Don't "shoot" at the barrels if there is noone to shoot
|
-- Don't "shoot" at the barrels if there is noone to shoot
|
||||||
if not FleeingUnits[1].IsDead then
|
if not FleeingUnits[1].IsDead then
|
||||||
FleeingUnits[1].Attack(Barrel)
|
FleeingUnits[1].Attack(Barrel, true, true)
|
||||||
elseif not FleeingUnits[2].IsDead then
|
elseif not FleeingUnits[2].IsDead then
|
||||||
FleeingUnits[2].Attack(Barrel)
|
FleeingUnits[2].Attack(Barrel, true, true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ Players:
|
|||||||
Faction: allies
|
Faction: allies
|
||||||
ColorRamp: 161,134,236
|
ColorRamp: 161,134,236
|
||||||
Allies: England, Soviet
|
Allies: England, Soviet
|
||||||
Enemies: USSR
|
Enemies: USSR, Creeps
|
||||||
PlayerReference@USSR:
|
PlayerReference@USSR:
|
||||||
Name: USSR
|
Name: USSR
|
||||||
AllowBots: False
|
AllowBots: False
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ Players:
|
|||||||
Faction: allies
|
Faction: allies
|
||||||
ColorRamp: 161,134,236
|
ColorRamp: 161,134,236
|
||||||
Allies: Soviet
|
Allies: Soviet
|
||||||
Enemies: USSR
|
Enemies: USSR, Creeps
|
||||||
PlayerReference@USSR:
|
PlayerReference@USSR:
|
||||||
Name: USSR
|
Name: USSR
|
||||||
AllowBots: False
|
AllowBots: False
|
||||||
|
|||||||
Reference in New Issue
Block a user