From be1ab707c5a678b600e5a3d8b3fa24cb47953d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Fri, 1 Nov 2013 11:20:52 +0100 Subject: [PATCH] separate TargetFlash from DrawLineToTarget --- OpenRA.Game/Traits/DrawLineToTarget.cs | 3 --- .../Widgets/WorldInteractionControllerWidget.cs | 10 ++++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/OpenRA.Game/Traits/DrawLineToTarget.cs b/OpenRA.Game/Traits/DrawLineToTarget.cs index 2fa04f64f1..da846940dc 100644 --- a/OpenRA.Game/Traits/DrawLineToTarget.cs +++ b/OpenRA.Game/Traits/DrawLineToTarget.cs @@ -97,9 +97,6 @@ namespace OpenRA.Traits if (self.Destroyed) return; - if (target.Type == TargetType.Actor && display) - w.Add(new FlashTarget(target.Actor)); - var line = self.TraitOrDefault(); if (line != null) line.SetTarget(self, target, color, display); diff --git a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs index d4b51db045..a04a8e4671 100644 --- a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs @@ -141,8 +141,14 @@ namespace OpenRA.Widgets orders.Do(o => world.IssueOrder(o)); world.PlayVoiceForOrders(orders); - if (orders.Where(o => o.OrderString != null && o.OrderString.EndsWith("Move")).Any()) - world.Add(new MoveFlash(worldRenderer.Viewport.ViewToWorldPosition(mi.Location), world)); + + foreach (var o in orders) + { + if (o.TargetActor != null) + world.Add(new FlashTarget(o.TargetActor)); + else if (o.TargetLocation != CPos.Zero) + world.Add(new MoveFlash(worldRenderer.Viewport.ViewToWorldPosition(mi.Location), world)); + } } public override string GetCursor(int2 screenPos)