From c34d987e4a7f5258096c1badc97126defcf5b7c9 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 22 Apr 2011 10:31:47 +1245 Subject: [PATCH] remove a couple of trait lookups --- OpenRA.Mods.RA/Activities/DeliverOre.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.RA/Activities/DeliverOre.cs b/OpenRA.Mods.RA/Activities/DeliverOre.cs index 3a90160c72..ee6a04869a 100755 --- a/OpenRA.Mods.RA/Activities/DeliverOre.cs +++ b/OpenRA.Mods.RA/Activities/DeliverOre.cs @@ -37,15 +37,16 @@ namespace OpenRA.Mods.RA.Activities return Util.SequenceActivities( new Wait(25), this ); var proc = harv.LinkedProc; + var iao = proc.Trait(); - if( self.Location != proc.Location + proc.Trait().DeliverOffset ) + if( self.Location != proc.Location + iao.DeliverOffset ) { - return Util.SequenceActivities( mobile.MoveTo(proc.Location + proc.Trait().DeliverOffset, 0), this ); + return Util.SequenceActivities( mobile.MoveTo(proc.Location + iao.DeliverOffset, 0), this ); } else if (!isDocking) { isDocking = true; - proc.Trait().OnDock(self, this); + iao.OnDock(self, this); } return Util.SequenceActivities( new Wait(10), this ); }