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

@@ -27,6 +27,7 @@ namespace OpenRA.Mods.Common.Activities
health = self.TraitOrDefault<Health>();
sellableInfo = self.Info.TraitInfo<SellableInfo>();
playerResources = self.Owner.PlayerActor.Trait<PlayerResources>();
IsInterruptible = false;
}
public override Activity Tick(Actor self)
@@ -45,8 +46,5 @@ namespace OpenRA.Mods.Common.Activities
self.Dispose();
return this;
}
// Cannot be cancelled
public override void Cancel(Actor self) { }
}
}