From 61c0b5d59b6c0f5507a9a13cd916e73b942961c9 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sun, 12 Jul 2015 18:32:58 +0200 Subject: [PATCH] Make refinery unblock cell customisable --- OpenRA.Mods.Common/Activities/FindResources.cs | 2 +- OpenRA.Mods.Common/Traits/Harvester.cs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Activities/FindResources.cs b/OpenRA.Mods.Common/Activities/FindResources.cs index 187c18c814..49205a5997 100644 --- a/OpenRA.Mods.Common/Activities/FindResources.cs +++ b/OpenRA.Mods.Common/Activities/FindResources.cs @@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.Activities // Only do this if UnblockRefinery did nothing. if (self.Location == cachedPosition) { - var unblockCell = harv.LastHarvestedCell ?? (self.Location + new CVec(0, 4)); + var unblockCell = harv.LastHarvestedCell ?? (self.Location + harvInfo.UnblockCell); var moveTo = mobile.NearestMoveableCell(unblockCell, 2, 5); self.QueueActivity(mobile.MoveTo(moveTo, 1)); self.SetTargetLine(Target.FromCell(self.World, moveTo), Color.Gray, false); diff --git a/OpenRA.Mods.Common/Traits/Harvester.cs b/OpenRA.Mods.Common/Traits/Harvester.cs index 47cf4c52c8..f2e4c49c09 100644 --- a/OpenRA.Mods.Common/Traits/Harvester.cs +++ b/OpenRA.Mods.Common/Traits/Harvester.cs @@ -26,6 +26,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("How long (in ticks) to wait until (re-)checking for a nearby available DeliveryBuilding if not yet linked to one.")] public readonly int SearchForDeliveryBuildingDelay = 125; + [Desc("Cell to move to when automatically unblocking DeliveryBuilding.")] + public readonly CVec UnblockCell = new CVec(0, 4); + [Desc("How much resources it can carry.")] public readonly int Capacity = 28; @@ -196,7 +199,8 @@ namespace OpenRA.Mods.Common.Traits if (self.Location == deliveryLoc) { // Get out of the way: - var moveTo = LastHarvestedCell ?? (deliveryLoc + new CVec(0, 4)); + var unblockCell = LastHarvestedCell ?? (deliveryLoc + info.UnblockCell); + var moveTo = mobile.NearestMoveableCell(unblockCell, 1, 5); self.QueueActivity(mobile.MoveTo(moveTo, 1)); self.SetTargetLine(Target.FromCell(self.World, moveTo), Color.Gray, false);