Simplify Activity class

After the removal of the CompositeActivity class, all the supporting
code that made it work can be removed as well.
This commit is contained in:
Oliver Brakmann
2019-03-26 03:11:03 +01:00
committed by Paul Chote
parent 19977bb7da
commit b4fd7331b2
6 changed files with 25 additions and 127 deletions

View File

@@ -222,13 +222,13 @@ namespace OpenRA
if (CurrentActivity == null)
CurrentActivity = nextActivity;
else
CurrentActivity.RootActivity.Queue(this, nextActivity);
CurrentActivity.Queue(this, nextActivity);
}
public void CancelActivity()
{
if (CurrentActivity != null)
CurrentActivity.RootActivity.Cancel(this);
CurrentActivity.Cancel(this);
}
public override int GetHashCode()
@@ -281,7 +281,7 @@ namespace OpenRA
// If CurrentActivity isn't null, run OnActorDisposeOuter in case some cleanups are needed.
// This should be done before the FrameEndTask to avoid dependency issues.
if (CurrentActivity != null)
CurrentActivity.RootActivity.OnActorDisposeOuter(this);
CurrentActivity.OnActorDisposeOuter(this);
// Allow traits/activities to prevent a race condition when they depend on disposing the actor (e.g. Transforms)
WillDispose = true;