Refactor AutoTarget scan and GPS interaction, and cache trait lookup for a slight performance boost

This commit is contained in:
ScottNZ
2014-06-07 02:05:10 +12:00
parent 5784444720
commit 7e6f7c51e1
10 changed files with 39 additions and 60 deletions

View File

@@ -53,7 +53,7 @@ namespace OpenRA.Mods.RA.Activities
return NextActivity;
// TODO: This is horrible, and probably wrong. Work out what it is trying to solve, then redo it properly.
if (type == TargetType.Actor && !self.Owner.HasFogVisibility() && Target.Actor.HasTrait<Mobile>() && !self.Owner.Shroud.IsTargetable(Target.Actor))
if (type == TargetType.Actor && Target.Actor.HasTrait<Mobile>() && !self.Owner.Shroud.IsTargetable(Target.Actor))
return NextActivity;
if (!Target.IsInRange(self.CenterPosition, Range))