Minor MoveOrderTargeter optimization
IsTraitPaused should be cheaper than Map.Contains, so let's perform the cheaper check first.
This commit is contained in:
@@ -1003,8 +1003,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
var explored = self.Owner.Shroud.IsExplored(location);
|
var explored = self.Owner.Shroud.IsExplored(location);
|
||||||
|
|
||||||
if (!self.World.Map.Contains(location)
|
if (mobile.IsTraitPaused
|
||||||
|| mobile.IsTraitPaused
|
|| !self.World.Map.Contains(location)
|
||||||
|| (!explored && !locomotorInfo.MoveIntoShroud)
|
|| (!explored && !locomotorInfo.MoveIntoShroud)
|
||||||
|| (explored && mobile.Locomotor.MovementCostForCell(location) == short.MaxValue))
|
|| (explored && mobile.Locomotor.MovementCostForCell(location) == short.MaxValue))
|
||||||
cursor = mobile.Info.BlockedCursor;
|
cursor = mobile.Info.BlockedCursor;
|
||||||
|
|||||||
Reference in New Issue
Block a user