Minor MoveOrderTargeter optimization

IsTraitPaused should be cheaper than Map.Contains,
so let's perform the cheaper check first.
This commit is contained in:
reaperrr
2021-07-24 17:25:10 +02:00
committed by teinarss
parent 58f55b808a
commit eff7e803bf

View File

@@ -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;