diff --git a/OpenRA.Mods.Common/Activities/FindAndDeliverResources.cs b/OpenRA.Mods.Common/Activities/FindAndDeliverResources.cs index 7ab71b445d..36ae82fd8a 100644 --- a/OpenRA.Mods.Common/Activities/FindAndDeliverResources.cs +++ b/OpenRA.Mods.Common/Activities/FindAndDeliverResources.cs @@ -176,11 +176,11 @@ namespace OpenRA.Mods.Common.Activities // Determine where to search from and how far to search: var searchFromLoc = lastHarvestedCell ?? GetSearchFromProcLocation(self); - var searchRadius = lastHarvestedCell.HasValue ? harvInfo.SearchFromOrderRadius : harvInfo.SearchFromProcRadius; + var searchRadius = lastHarvestedCell.HasValue ? harvInfo.SearchFromHarvesterRadius : harvInfo.SearchFromProcRadius; if (!searchFromLoc.HasValue) { searchFromLoc = self.Location; - searchRadius = harvInfo.SearchFromOrderRadius; + searchRadius = harvInfo.SearchFromHarvesterRadius; } var searchRadiusSquared = searchRadius * searchRadius; diff --git a/OpenRA.Mods.Common/Traits/Harvester.cs b/OpenRA.Mods.Common/Traits/Harvester.cs index 36731fc9fb..a016cc8662 100644 --- a/OpenRA.Mods.Common/Traits/Harvester.cs +++ b/OpenRA.Mods.Common/Traits/Harvester.cs @@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Traits public readonly int SearchFromProcRadius = 24; [Desc("Search radius (in cells) from the last harvest order location to find more resources.")] - public readonly int SearchFromOrderRadius = 12; + public readonly int SearchFromHarvesterRadius = 12; [Desc("Interval to wait between searches when there are no resources nearby.")] public readonly int WaitDuration = 25; diff --git a/OpenRA.Mods.Common/UpdateRules/Rules/20190314/RenameSearchRadius.cs b/OpenRA.Mods.Common/UpdateRules/Rules/20190314/RenameSearchRadius.cs new file mode 100644 index 0000000000..9ad2344348 --- /dev/null +++ b/OpenRA.Mods.Common/UpdateRules/Rules/20190314/RenameSearchRadius.cs @@ -0,0 +1,35 @@ +#region Copyright & License Information +/* + * Copyright 2007-2019 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. For more + * information, see COPYING. + */ +#endregion + +using System.Collections.Generic; + +namespace OpenRA.Mods.Common.UpdateRules.Rules +{ + class RenameSearchRadius : UpdateRule + { + public override string Name { get { return "Rename SearchFromOrderRadius to SearchFromHarvesterRadius"; } } + public override string Description + { + get + { + return "Renamed 'SearchFromOrderRadius' to 'SearchFromHarvesterRadius'."; + } + } + + public override IEnumerable UpdateActorNode(ModData modData, MiniYamlNode actorNode) + { + foreach (var harvester in actorNode.ChildrenMatching("Harvester")) + harvester.RenameChildrenMatching("SearchFromOrderRadius", "SearchFromHarvesterRadius"); + + yield break; + } + } +} diff --git a/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs b/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs index bd4135638a..0199922049 100644 --- a/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs +++ b/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs @@ -132,6 +132,7 @@ namespace OpenRA.Mods.Common.UpdateRules new RenameCarryallDelays(), new AddCanSlide(), new AddAircraftIdleBehavior(), + new RenameSearchRadius(), }) };