Fix for potential infinite loop freeze

This commit is contained in:
reaperrr
2015-07-12 01:02:25 +02:00
parent 787609d51e
commit 62e05cf618

View File

@@ -134,6 +134,9 @@ namespace OpenRA.Mods.Common.Activities
/// </summary>
CPos? ClosestHarvestablePos(Actor self)
{
if (IsHarvestable(self, self.Location))
return self.Location;
// Determine where to search from and how far to search:
var searchFromLoc = harv.LastOrderLocation ?? (harv.LastLinkedProc ?? harv.LinkedProc ?? self).Location;
var searchRadius = harv.LastOrderLocation.HasValue ? harvInfo.SearchFromOrderRadius : harvInfo.SearchFromProcRadius;