Further untangle (and - hopefully - fix) the afterLandActivity mess
This commit is contained in:
@@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
if (self.Location != proc.Location + iao.DeliveryOffset)
|
||||
{
|
||||
foreach (var n in self.TraitsImplementing<INotifyHarvesterAction>())
|
||||
n.MovingToRefinery(self, proc, this);
|
||||
n.MovingToRefinery(self, proc, null);
|
||||
|
||||
return ActivityUtils.SequenceActivities(movement.MoveTo(proc.Location + iao.DeliveryOffset, 0), this);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
using System.Linq;
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.Mods.Common.Activities;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
@@ -88,15 +87,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Destination = null;
|
||||
|
||||
if (afterLandActivity != null)
|
||||
{
|
||||
// HACK: Harvesters need special treatment to avoid getting stuck on resource fields,
|
||||
// so if a Harvester's afterLandActivity is not DeliverResources, queue a new FindResources activity
|
||||
var findResources = self.Info.HasTraitInfo<HarvesterInfo>() && !(afterLandActivity is DeliverResources);
|
||||
if (findResources)
|
||||
self.QueueActivity(new FindResources(self));
|
||||
else
|
||||
self.QueueActivity(false, afterLandActivity);
|
||||
}
|
||||
|
||||
base.Detached(self);
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
self.QueueActivity(new DeliverResources(self));
|
||||
|
||||
foreach (var n in notifyHarvesterAction)
|
||||
n.MovingToRefinery(self, targetActor, new DeliverResources(self));
|
||||
n.MovingToRefinery(self, targetActor, null);
|
||||
}
|
||||
else if (order.OrderString == "Stop" || order.OrderString == "Move")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user