Replace pseudo-childactivities in WaitForTransport.
This commit is contained in:
@@ -19,34 +19,25 @@ namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
readonly ICallForTransport transportable;
|
||||
|
||||
Activity inner;
|
||||
|
||||
public WaitForTransport(Actor self, Activity innerActivity)
|
||||
{
|
||||
transportable = self.TraitOrDefault<ICallForTransport>();
|
||||
inner = innerActivity;
|
||||
QueueChild(self, innerActivity);
|
||||
}
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
if (inner == null)
|
||||
if (ChildActivity != null)
|
||||
{
|
||||
ChildActivity = ActivityUtils.RunActivity(self, ChildActivity);
|
||||
if (ChildActivity != null)
|
||||
return this;
|
||||
}
|
||||
|
||||
if (transportable != null)
|
||||
transportable.MovementCancelled(self);
|
||||
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
inner = ActivityUtils.RunActivity(self, inner);
|
||||
return this;
|
||||
}
|
||||
|
||||
public override void Cancel(Actor self, bool keepQueue = false)
|
||||
{
|
||||
if (!IsCanceling && inner != null)
|
||||
inner.Cancel(self);
|
||||
|
||||
base.Cancel(self, keepQueue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user