From 7f4fbfcf467c3f1223d6f3494e67dcb8b9f902d9 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Fri, 19 Jul 2019 18:21:16 +0200 Subject: [PATCH] Change Resupply closeEnough 'infinite' to negative ...instead of 'zero'. Returning 'true' at a distance of zero was a legacy left-over that isn't used anymore once #16695 is merged. --- OpenRA.Mods.Common/Activities/Resupply.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Activities/Resupply.cs b/OpenRA.Mods.Common/Activities/Resupply.cs index 0b27c2b4ac..27d6f61188 100644 --- a/OpenRA.Mods.Common/Activities/Resupply.cs +++ b/OpenRA.Mods.Common/Activities/Resupply.cs @@ -79,7 +79,7 @@ namespace OpenRA.Mods.Common.Activities // HACK: If the activity is cancelled while we're already resupplying (or about to start resupplying), // move actor outside the resupplier footprint. // TODO: This check is nowhere near robust enough, and should be rewritten. - var isCloseEnough = closeEnough.LengthSquared == 0 || (host.CenterPosition - self.CenterPosition).HorizontalLengthSquared <= closeEnough.LengthSquared; + var isCloseEnough = closeEnough < WDist.Zero || (host.CenterPosition - self.CenterPosition).HorizontalLengthSquared <= closeEnough.LengthSquared; if (IsCanceling && isCloseEnough) { foreach (var notifyResupply in notifyResupplies)