Fix aircraft that don't rearm stalling over invalid targets
This commit is contained in:
@@ -119,10 +119,14 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
if (useLastVisibleTarget && !lastVisibleTarget.IsValidFor(self))
|
if (useLastVisibleTarget && !lastVisibleTarget.IsValidFor(self))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// If all valid weapons have depleted their ammo and Rearmable trait exists, return to RearmActor to reload
|
// If all weapons are invalid against the target
|
||||||
// and resume the activity after reloading if AbortOnResupply is set to 'false'
|
if (!useLastVisibleTarget && attackAircraft.Armaments.All(x => x.IsTraitPaused || !x.Weapon.IsValidAgainst(target, self.World, self)))
|
||||||
if (rearmable != null && !useLastVisibleTarget && attackAircraft.Armaments.All(x => x.IsTraitPaused || !x.Weapon.IsValidAgainst(target, self.World, self)))
|
|
||||||
{
|
{
|
||||||
|
// If Rearmable trait exists, return to RearmActor to reload and resume the activity after
|
||||||
|
// reloading if AbortOnResupply is set to 'false'.
|
||||||
|
if (rearmable == null)
|
||||||
|
return true;
|
||||||
|
|
||||||
// Attack moves never resupply
|
// Attack moves never resupply
|
||||||
if (source == AttackSource.AttackMove)
|
if (source == AttackSource.AttackMove)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user