From 7f64495d6f8ec4320467c869ee00d65152c94698 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Sun, 4 Sep 2016 12:08:20 +0200 Subject: [PATCH] Make aircraft continue attack on same target after re-arming --- OpenRA.Mods.Common/Activities/Air/FlyAttack.cs | 3 +-- OpenRA.Mods.Common/Activities/Air/HeliAttack.cs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs b/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs index afe383dd46..bfa00d0493 100644 --- a/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs +++ b/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs @@ -40,10 +40,9 @@ namespace OpenRA.Mods.Common.Activities if (!target.IsValidFor(self)) return NextActivity; - // Move to the next activity only if all ammo pools are depleted and none reload automatically // TODO: This should check whether there is ammo left that is actually suitable for the target if (ammoPools.All(x => !x.Info.SelfReloads && !x.HasAmmo())) - return ActivityUtils.SequenceActivities(new ReturnToBase(self), NextActivity); + return ActivityUtils.SequenceActivities(new ReturnToBase(self), this); if (attackPlane != null) attackPlane.DoAttack(self, target); diff --git a/OpenRA.Mods.Common/Activities/Air/HeliAttack.cs b/OpenRA.Mods.Common/Activities/Air/HeliAttack.cs index c8dd30e49a..cb00a2af7f 100644 --- a/OpenRA.Mods.Common/Activities/Air/HeliAttack.cs +++ b/OpenRA.Mods.Common/Activities/Air/HeliAttack.cs @@ -65,9 +65,9 @@ namespace OpenRA.Mods.Common.Activities return ActivityUtils.SequenceActivities(new HeliFly(self, newTarget)); } - // If any AmmoPool is depleted and no weapon is valid against target, return to helipad to reload and then move to next activity + // If any AmmoPool is depleted and no weapon is valid against target, return to helipad to reload and then resume the activity if (ammoPools.Any(x => !x.Info.SelfReloads && !x.HasAmmo()) && !attackHeli.HasAnyValidWeapons(target)) - return ActivityUtils.SequenceActivities(new HeliReturnToBase(self), NextActivity); + return ActivityUtils.SequenceActivities(new HeliReturnToBase(self), this); var dist = target.CenterPosition - self.CenterPosition;