From eff7e803bf4329b6c0b7bece3a7d9b1c463b7314 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sat, 24 Jul 2021 17:25:10 +0200 Subject: [PATCH] Minor MoveOrderTargeter optimization IsTraitPaused should be cheaper than Map.Contains, so let's perform the cheaper check first. --- OpenRA.Mods.Common/Traits/Mobile.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Mobile.cs b/OpenRA.Mods.Common/Traits/Mobile.cs index 88342de839..e479b68c58 100644 --- a/OpenRA.Mods.Common/Traits/Mobile.cs +++ b/OpenRA.Mods.Common/Traits/Mobile.cs @@ -1003,8 +1003,8 @@ namespace OpenRA.Mods.Common.Traits var explored = self.Owner.Shroud.IsExplored(location); - if (!self.World.Map.Contains(location) - || mobile.IsTraitPaused + if (mobile.IsTraitPaused + || !self.World.Map.Contains(location) || (!explored && !locomotorInfo.MoveIntoShroud) || (explored && mobile.Locomotor.MovementCostForCell(location) == short.MaxValue)) cursor = mobile.Info.BlockedCursor;