Move ChildActivity handling into base Activity class.
This commit is contained in:
@@ -75,19 +75,12 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
if (ChildActivity != null)
|
||||
{
|
||||
ChildActivity = ActivityUtils.RunActivity(self, ChildActivity);
|
||||
if (ChildActivity != null)
|
||||
return this;
|
||||
}
|
||||
|
||||
// HACK: If the activity is cancelled while we're already resupplying (or about to start resupplying),
|
||||
// move actor outside the resupplier footprint
|
||||
// TODO: This check is nowhere near robust enough, and should be rewritten
|
||||
if (IsCanceling && host.IsInRange(self.CenterPosition, closeEnough))
|
||||
{
|
||||
QueueChild(self, self.Trait<IMove>().MoveToTarget(self, host), true);
|
||||
QueueChild(self.Trait<IMove>().MoveToTarget(self, host));
|
||||
foreach (var notifyResupply in notifyResupplies)
|
||||
notifyResupply.ResupplyTick(host.Actor, self, ResupplyType.None);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user