diff --git a/OpenRA.Mods.RA/Harvester.cs b/OpenRA.Mods.RA/Harvester.cs index f646fd7867..a0633791a1 100644 --- a/OpenRA.Mods.RA/Harvester.cs +++ b/OpenRA.Mods.RA/Harvester.cs @@ -268,8 +268,9 @@ namespace OpenRA.Mods.RA LinkProc(self, OwnerLinkedProc = null); idleSmart = true; - var mobile = self.Trait(); self.CancelActivity(); + + var mobile = self.Trait(); if (order.TargetLocation != CPos.Zero) { var loc = order.TargetLocation; @@ -295,7 +296,7 @@ namespace OpenRA.Mods.RA else { // A bot order gives us a CPos.Zero TargetLocation, so find some good resources for him: - CPos? loc = FindNextResourceForBot(self); + var loc = FindNextResourceForBot(self); // No more resources? Oh well. if (!loc.HasValue) return; @@ -306,6 +307,8 @@ namespace OpenRA.Mods.RA LastOrderLocation = loc; } + // This prevents harvesters returning to an empty patch when the player orders them to a new patch: + LastHarvestedCell = LastOrderLocation; self.QueueActivity(new FindResources()); } else if (order.OrderString == "Deliver")