Merge pull request #11232 from abcdefg30/navalRepair

Fix possible instant repairs by spamming Repair activities
This commit is contained in:
Paul Chote
2016-05-07 10:30:57 +01:00

View File

@@ -32,11 +32,20 @@ namespace OpenRA.Mods.Common.Activities
public override Activity Tick(Actor self)
{
if (IsCanceled) return NextActivity;
if (host == null || !host.IsInWorld) return NextActivity;
if (IsCanceled)
{
if (remainingTicks-- == 0)
return NextActivity;
return this;
}
if (host == null || !host.IsInWorld)
return NextActivity;
health = self.TraitOrDefault<Health>();
if (health == null) return NextActivity;
if (health == null)
return NextActivity;
if (health.DamageState == DamageState.Undamaged)
{