Make VisualMove uninterruptible by making Turn a Child of Drag.

This commit is contained in:
tovl
2019-07-27 22:02:59 +02:00
committed by teinarss
parent 207305e7d2
commit 8c7ff3b5b0
2 changed files with 10 additions and 4 deletions

View File

@@ -23,17 +23,25 @@ namespace OpenRA.Mods.Common.Activities
WPos start, end;
int length;
int ticks = 0;
int desiredFacing;
public Drag(Actor self, WPos start, WPos end, int length)
public Drag(Actor self, WPos start, WPos end, int length, int facing = -1)
{
positionable = self.Trait<IPositionable>();
disableable = self.TraitOrDefault<IMove>() as IDisabledTrait;
this.start = start;
this.end = end;
this.length = length;
desiredFacing = facing;
IsInterruptible = false;
}
protected override void OnFirstRun(Actor self)
{
if (desiredFacing != -1)
QueueChild(new Turn(self, desiredFacing));
}
public override bool Tick(Actor self)
{
if (disableable != null && disableable.IsTraitDisabled)