From ac3f63b59c143aff1e9a74ada2fec4ba9d8eff5f Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 21 Jul 2013 10:03:48 +1200 Subject: [PATCH] Remove IHasLocation lookup from Target. --- OpenRA.Game/Traits/Target.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenRA.Game/Traits/Target.cs b/OpenRA.Game/Traits/Target.cs index 39d0153123..6dd8031a0a 100644 --- a/OpenRA.Game/Traits/Target.cs +++ b/OpenRA.Game/Traits/Target.cs @@ -45,8 +45,7 @@ namespace OpenRA.Traits } public bool IsValid { get { return valid && (actor == null || (actor.IsInWorld && !actor.IsDead() && actor.Generation == generation)); } } - public PPos PxPosition { get { return IsActor ? actor.Trait().PxPosition : PPos.FromWPos(pos); } } - public PPos CenterLocation { get { return PxPosition; } } + public PPos CenterLocation { get { return IsActor ? actor.CenterLocation : PPos.FromWPos(pos); } } public Actor Actor { get { return IsActor ? actor : null; } } // TODO: This should return true even if the actor is destroyed