Rename SearchFromOrderRadius to SearchFromHarvesterRadius

This commit is contained in:
abcdefg30
2019-08-10 13:31:47 +02:00
committed by teinarss
parent 698ef5e375
commit bfc3e1354b
4 changed files with 39 additions and 3 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
foreach (var harvester in actorNode.ChildrenMatching("Harvester"))
harvester.RenameChildrenMatching("SearchFromOrderRadius", "SearchFromHarvesterRadius");
yield break;
}
}
}

View File

@@ -132,6 +132,7 @@ namespace OpenRA.Mods.Common.UpdateRules
new RenameCarryallDelays(),
new AddCanSlide(),
new AddAircraftIdleBehavior(),
new RenameSearchRadius(),
})
};