Fix force fire opportunity targets not being persisted properly

This commit is contained in:
abcdefg30
2022-06-09 14:41:50 +02:00
committed by Matthias Mailänder
parent 5f86f56bed
commit d830bca706
2 changed files with 69 additions and 0 deletions

View File

@@ -156,6 +156,10 @@ namespace OpenRA.Mods.Common.Traits
public override Activity GetAttackActivity(Actor self, AttackSource source, in Target newTarget, bool allowMove, bool forceAttack, Color? targetLineColor = null)
{
// HACK: Manually set force attacking if we persisted an opportunity target that required force attacking
if (opportunityTargetIsPersistentTarget && opportunityForceAttack && newTarget == OpportunityTarget)
forceAttack = true;
return new AttackActivity(self, newTarget, allowMove, forceAttack, targetLineColor);
}