From 3548dacad305b8b997059815cd9caa824c5f6fe3 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 21 Oct 2011 16:52:50 +1300 Subject: [PATCH] collapse useless layer of crap in DrawLineToTarget --- OpenRA.Game/Traits/DrawLineToTarget.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/OpenRA.Game/Traits/DrawLineToTarget.cs b/OpenRA.Game/Traits/DrawLineToTarget.cs index aa17f3a954..f28be31679 100644 --- a/OpenRA.Game/Traits/DrawLineToTarget.cs +++ b/OpenRA.Game/Traits/DrawLineToTarget.cs @@ -33,16 +33,11 @@ namespace OpenRA.Traits int lifetime; Color c; - public void SetTarget(Actor self, Target target, Color c) - { - this.target = target; - lifetime = Info.Ticks; - this.c = c; - } - - public void SetTargetSilently(Actor self, Target target, Color c) + public void SetTarget(Actor self, Target target, Color c, bool display) { this.target = target; + if (display) + lifetime = Info.Ticks; this.c = c; } @@ -96,10 +91,7 @@ namespace OpenRA.Traits var line = self.TraitOrDefault(); if (line != null) - if (display) - line.SetTarget(self, target, color); - else - line.SetTargetSilently(self, target, color); + line.SetTarget(self, target, color, display); }); } }