Fix possible instant repairs by spamming Repair activities

Noticeable when spam-clicking on a naval yard/sub pen.
This commit is contained in:
abcdefg30
2016-05-06 17:51:24 +02:00
parent f80449be31
commit 25b1c991a2

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)
{