Merge pull request #12919 from obrakmann/transform-refactor

Refactor Transform to make use of child activities
This commit is contained in:
reaperrr
2017-05-04 18:55:41 +02:00
committed by GitHub
14 changed files with 86 additions and 64 deletions

View File

@@ -201,7 +201,7 @@ namespace OpenRA.Activities
/// </summary>
protected virtual void OnLastRun(Actor self) { }
public virtual bool Cancel(Actor self)
public virtual bool Cancel(Actor self, bool keepQueue = false)
{
if (!IsInterruptible)
return false;
@@ -209,9 +209,11 @@ namespace OpenRA.Activities
if (ChildActivity != null && !ChildActivity.Cancel(self))
return false;
State = ActivityState.Canceled;
NextActivity = null;
if (!keepQueue)
NextActivity = null;
ChildActivity = null;
State = ActivityState.Canceled;
return true;
}