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

@@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA.Activities
return NextActivity;
var mobile = self.Trait<Mobile>();
var nearest = target.Trait<IOccupySpace>().NearestCellTo( mobile.toCell );
var nearest = target.OccupiesSpace.NearestCellTo( mobile.toCell );
if( ( nearest - mobile.toCell ).LengthSquared > 2 )
return Util.SequenceActivities( new MoveAdjacentTo( target ), this );