Clean up Harvester and FindResources unblocking

This commit is contained in:
reaperrr
2016-01-29 02:26:45 +01:00
parent 7b315aa9cc
commit 75736cb127
2 changed files with 4 additions and 22 deletions

View File

@@ -67,17 +67,10 @@ namespace OpenRA.Mods.Common.Activities
if (!harv.IsEmpty)
return deliver;
var cachedPosition = self.Location;
harv.UnblockRefinery(self);
// Only do this if UnblockRefinery did nothing.
if (self.Location == cachedPosition)
{
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);
}
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);
var randFrames = self.World.SharedRandom.Next(100, 175);
return ActivityUtils.SequenceActivities(NextActivity, new Wait(randFrames), this);