Fix spamming repair orders repairing faster

This commit is contained in:
abcdefg30
2019-08-08 16:49:14 +02:00
committed by Paul Chote
parent c0d5cd750d
commit d1c56d78e1

View File

@@ -76,6 +76,13 @@ namespace OpenRA.Mods.Common.Activities
public override bool Tick(Actor self) public override bool Tick(Actor self)
{ {
// Wait for the cooldown to expire before releasing the unit if this was cancelled
if (IsCanceling && remainingTicks > 0)
{
remainingTicks--;
return false;
}
var isHostInvalid = host.Type != TargetType.Actor || !host.Actor.IsInWorld; var isHostInvalid = host.Type != TargetType.Actor || !host.Actor.IsInWorld;
var isCloseEnough = closeEnough < WDist.Zero || (!isHostInvalid && (host.CenterPosition - self.CenterPosition).HorizontalLengthSquared <= closeEnough.LengthSquared); var isCloseEnough = closeEnough < WDist.Zero || (!isHostInvalid && (host.CenterPosition - self.CenterPosition).HorizontalLengthSquared <= closeEnough.LengthSquared);