Fix repair cursor visual feedback target.

This commit is contained in:
Paul Chote
2017-04-22 22:31:59 +01:00
parent 99f3f37afe
commit d9800d4e2b
3 changed files with 5 additions and 3 deletions

View File

@@ -46,6 +46,7 @@ namespace OpenRA
public uint ExtraData; public uint ExtraData;
public bool IsImmediate; public bool IsImmediate;
public bool SuppressVisualFeedback; public bool SuppressVisualFeedback;
public Actor VisualFeedbackTarget;
public Player Player { get { return Subject != null ? Subject.Owner : null; } } public Player Player { get { return Subject != null ? Subject.Owner : null; } }

View File

@@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Orders
if (repairBuilding == null) if (repairBuilding == null)
yield break; yield break;
yield return new Order(orderId, underCursor, false) { TargetActor = repairBuilding }; yield return new Order(orderId, underCursor, false) { TargetActor = repairBuilding, VisualFeedbackTarget = underCursor };
} }
public void Tick(World world) public void Tick(World world)

View File

@@ -194,9 +194,10 @@ namespace OpenRA.Mods.Common.Widgets
if (!flashed && !o.SuppressVisualFeedback) if (!flashed && !o.SuppressVisualFeedback)
{ {
if (o.TargetActor != null) var visualTargetActor = o.VisualFeedbackTarget ?? o.TargetActor;
if (visualTargetActor != null)
{ {
world.AddFrameEndTask(w => w.Add(new FlashTarget(o.TargetActor))); world.AddFrameEndTask(w => w.Add(new FlashTarget(visualTargetActor)));
flashed = true; flashed = true;
} }
else if (o.TargetLocation != CPos.Zero) else if (o.TargetLocation != CPos.Zero)