Perform FogObscures as late as possible
FogObscures is more expensive than simpler boolean, player or HasTraitInfo checks, so in these places it makes sense to perform the other checks first.
This commit is contained in:
@@ -21,7 +21,7 @@ namespace OpenRA.Orders
|
||||
static Target TargetForInput(World world, CPos cell, int2 worldPixel, MouseInput mi)
|
||||
{
|
||||
var actor = world.ScreenMap.ActorsAt(mi)
|
||||
.Where(a => !world.FogObscures(a) && a.Info.HasTraitInfo<ITargetableInfo>())
|
||||
.Where(a => a.Info.HasTraitInfo<ITargetableInfo>() && !world.FogObscures(a))
|
||||
.WithHighestSelectionPriority(worldPixel);
|
||||
|
||||
if (actor != null)
|
||||
|
||||
Reference in New Issue
Block a user