From 75e32c0573dea199479802ea3a20b85afa35b20e Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 4 Mar 2012 11:17:46 +1300 Subject: [PATCH] don't fetch IFacing unless we actually need it, in Attack --- OpenRA.Mods.RA/Activities/Attack.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Activities/Attack.cs b/OpenRA.Mods.RA/Activities/Attack.cs index e290444337..4768b162d3 100755 --- a/OpenRA.Mods.RA/Activities/Attack.cs +++ b/OpenRA.Mods.RA/Activities/Attack.cs @@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA.Activities protected virtual Activity InnerTick( Actor self, AttackBase attack ) { if (IsCanceled) return NextActivity; - var facing = self.Trait(); + if (!Target.IsValid) return NextActivity; @@ -70,6 +70,7 @@ namespace OpenRA.Mods.RA.Activities } var desiredFacing = Util.GetFacing(Target.CenterLocation - self.CenterLocation, 0); + var facing = self.Trait(); if (facing.Facing != desiredFacing) return Util.SequenceActivities( new Turn( desiredFacing ), this );