Cache trait lookups in MoveAdjacentTo.

This commit is contained in:
Paul Chote
2014-01-09 17:59:20 +13:00
parent 27ef3352f4
commit c333b59eb9
8 changed files with 16 additions and 10 deletions

View File

@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Activities
return NextActivity;
if (!Util.AdjacentCells(target).Any(c => c == self.Location))
return Util.SequenceActivities(new MoveAdjacentTo(target), this);
return Util.SequenceActivities(new MoveAdjacentTo(self, target), this);
// Move to the middle of the target, ignoring impassable tiles
var mobile = self.Trait<Mobile>();