Add native support for uninterruptible activities

This pattern occurs a few times throughout the code, so it makes sense to bake it into the Activity class itself.
This commit is contained in:
Oliver Brakmann
2016-10-29 17:38:10 +02:00
parent 3e9bf7aa4d
commit 2c66ee8c13
20 changed files with 76 additions and 75 deletions

View File

@@ -157,12 +157,12 @@ namespace OpenRA.Mods.Common.Activities
});
}
public override void Cancel(Actor self)
public override bool Cancel(Actor self)
{
if (innerActivity != null)
innerActivity.Cancel(self);
if (!IsCanceled && innerActivity != null && !innerActivity.Cancel(self))
return false;
base.Cancel(self);
return base.Cancel(self);
}
}
}