Remove Order.TargetLocation from Harvester.
This commit is contained in:
@@ -391,11 +391,12 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
self.CancelActivity();
|
||||
|
||||
CPos? loc;
|
||||
if (order.TargetLocation != CPos.Zero)
|
||||
CPos loc;
|
||||
if (order.Target.Type != TargetType.Invalid)
|
||||
{
|
||||
// Find the nearest claimable cell to the order location (useful for group-select harvest):
|
||||
loc = mobile.NearestCell(order.TargetLocation, p => mobile.CanEnterCell(p) && claimLayer.TryClaimCell(self, p), 1, 6);
|
||||
var cell = self.World.Map.CellContaining(order.Target.CenterPosition);
|
||||
loc = mobile.NearestCell(cell, p => mobile.CanEnterCell(p) && claimLayer.TryClaimCell(self, p), 1, 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -403,7 +404,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
loc = self.Location;
|
||||
}
|
||||
|
||||
self.SetTargetLine(Target.FromCell(self.World, loc.Value), Color.Red);
|
||||
self.SetTargetLine(Target.FromCell(self.World, loc), Color.Red);
|
||||
|
||||
// FindResources takes care of calling INotifyHarvesterAction
|
||||
self.QueueActivity(new FindResources(self));
|
||||
|
||||
Reference in New Issue
Block a user