Add IMove.MoveOntoTarget interface

In `TraitsInterfaces` we expose offset as WPos instead of CPos. In an upcoming PR we'll translate the same change to yaml.
This commit is contained in:
Gustas
2023-01-20 21:29:50 +02:00
committed by Matthias Mailänder
parent ad683d9226
commit dc390a7301
13 changed files with 76 additions and 25 deletions

View File

@@ -62,12 +62,13 @@ namespace OpenRA.Mods.Common.Activities
proc = harv.LinkedProc;
var iao = proc.Trait<IAcceptResources>();
if (self.Location != proc.Location + iao.DeliveryOffset)
if (self.CenterPosition != iao.DeliveryPosition)
{
foreach (var n in notifyHarvesterActions)
n.MovingToRefinery(self, proc);
QueueChild(movement.MoveTo(proc.Location + iao.DeliveryOffset, 0));
var target = Target.FromActor(proc);
QueueChild(movement.MoveOntoTarget(self, target, iao.DeliveryPosition - proc.CenterPosition, iao.DeliveryAngle));
return false;
}