remove trait lookup spam everywhere for IOccupySpace.

This commit is contained in:
Chris Forbes
2011-08-02 19:43:02 +12:00
parent aff3111eac
commit 663a323f29
11 changed files with 35 additions and 37 deletions

View File

@@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA.Activities
{
if (IsCanceled) return NextActivity;
if (target == null || !target.IsInWorld || target.IsDead()) return NextActivity;
if( !target.Trait<IOccupySpace>().OccupiedCells().Any( x => x.First == self.Location ) )
if( !target.OccupiesSpace.OccupiedCells().Any( x => x.First == self.Location ) )
return NextActivity;
var health = target.Trait<Health>();