diff --git a/OpenRA.Mods.Common/Activities/Air/ResupplyAircraft.cs b/OpenRA.Mods.Common/Activities/Air/ResupplyAircraft.cs index 01165caeca..7068c907db 100644 --- a/OpenRA.Mods.Common/Activities/Air/ResupplyAircraft.cs +++ b/OpenRA.Mods.Common/Activities/Air/ResupplyAircraft.cs @@ -43,24 +43,24 @@ namespace OpenRA.Mods.Common.Activities inner = ActivityUtils.SequenceActivities( aircraft.GetResupplyActivities(host) .Append(new AllowYieldingReservation(self)) - .Append(new WaitFor(() => NextActivity != null || aircraft.ReservedActor == null)) + .Append(new WaitFor(() => NextInQueue != null || aircraft.ReservedActor == null)) .ToArray()); } else { // Helicopters should take off from their helipad immediately after resupplying. - // HACK: Append NextActivity to TakeOff to avoid moving to the Rallypoint (if NextActivity is non-null). + // HACK: Append NextInQueue to TakeOff to avoid moving to the Rallypoint (if NextInQueue is non-null). inner = ActivityUtils.SequenceActivities( aircraft.GetResupplyActivities(host) .Append(new AllowYieldingReservation(self)) - .Append(new TakeOff(self)).Append(NextActivity).ToArray()); + .Append(new TakeOff(self)).Append(NextInQueue).ToArray()); } } else inner = ActivityUtils.RunActivity(self, inner); - // The inner == NextActivity check is needed here because of the TakeOff issue mentioned in the comment above. - return inner == null || inner == NextActivity ? NextActivity : this; + // The inner == NextInQueue check is needed here because of the TakeOff issue mentioned in the comment above. + return inner == null || inner == NextInQueue ? NextActivity : this; } public override bool Cancel(Actor self) diff --git a/OpenRA.Mods.Common/Activities/Air/TakeOff.cs b/OpenRA.Mods.Common/Activities/Air/TakeOff.cs index 4f0cfe4690..c271d565aa 100644 --- a/OpenRA.Mods.Common/Activities/Air/TakeOff.cs +++ b/OpenRA.Mods.Common/Activities/Air/TakeOff.cs @@ -37,10 +37,10 @@ namespace OpenRA.Mods.Common.Activities var destination = rp != null ? rp.Location : (hasHost ? self.World.Map.CellContaining(host.CenterPosition) : self.Location); - if (NextActivity == null) + if (NextInQueue == null) return new AttackMoveActivity(self, move.MoveTo(destination, 1)); else - return NextActivity; + return NextInQueue; } } } diff --git a/OpenRA.Mods.Common/Activities/DeliverResources.cs b/OpenRA.Mods.Common/Activities/DeliverResources.cs index d3b633d942..8ec4865794 100644 --- a/OpenRA.Mods.Common/Activities/DeliverResources.cs +++ b/OpenRA.Mods.Common/Activities/DeliverResources.cs @@ -35,8 +35,8 @@ namespace OpenRA.Mods.Common.Activities public override Activity Tick(Actor self) { - if (NextActivity != null) - return NextActivity; + if (NextInQueue != null) + return NextInQueue; // Find the nearest best refinery if not explicitly ordered to a specific refinery: if (harv.OwnerLinkedProc == null || !harv.OwnerLinkedProc.IsInWorld) diff --git a/OpenRA.Mods.Common/Activities/FindResources.cs b/OpenRA.Mods.Common/Activities/FindResources.cs index 7e99d9bb99..443dc167be 100644 --- a/OpenRA.Mods.Common/Activities/FindResources.cs +++ b/OpenRA.Mods.Common/Activities/FindResources.cs @@ -51,9 +51,12 @@ namespace OpenRA.Mods.Common.Activities public override Activity Tick(Actor self) { - if (IsCanceled || NextActivity != null) + if (IsCanceled) return NextActivity; + if (NextInQueue != null) + return NextInQueue; + var deliver = new DeliverResources(self); if (harv.IsFull) @@ -81,8 +84,8 @@ namespace OpenRA.Mods.Common.Activities var randFrames = self.World.SharedRandom.Next(100, 175); // Avoid creating an activity cycle - var next = NextActivity; - NextActivity = null; + var next = NextInQueue; + NextInQueue = null; return ActivityUtils.SequenceActivities(next, new Wait(randFrames), this); } else