Move AbortOnResupply to AttackAircraft

Additionally, if AbortOnResupply is set to 'true',
abort FlyAttack right away when queueing ReturnToBase.
This commit is contained in:
reaperrr
2019-07-01 02:19:30 +02:00
committed by Paul Chote
parent 1f16cb6864
commit e4011b86ac
4 changed files with 66 additions and 5 deletions

View File

@@ -111,11 +111,12 @@ namespace OpenRA.Mods.Common.Activities
return true;
}
// If all valid weapons have depleted their ammo and Rearmable trait exists, return to RearmActor to reload and then resume the activity
// If all valid weapons have depleted their ammo and Rearmable trait exists, return to RearmActor to reload
// and resume the activity after reloading if AbortOnResupply is set to 'false'
if (rearmable != null && !useLastVisibleTarget && attackAircraft.Armaments.All(x => x.IsTraitPaused || !x.Weapon.IsValidAgainst(target, self.World, self)))
{
QueueChild(new ReturnToBase(self));
return aircraft.Info.AbortOnResupply;
return attackAircraft.Info.AbortOnResupply;
}
var pos = self.CenterPosition;