Unify TargetFlash handling around Targets.

This commit is contained in:
Paul Chote
2018-05-27 11:36:08 +00:00
committed by reaperrr
parent d0be594609
commit 768265bbd2
5 changed files with 14 additions and 29 deletions

View File

@@ -121,23 +121,5 @@ namespace OpenRA.Mods.Common.Traits
line.SetTarget(self, target, color, display);
});
}
public static void SetTargetLine(this Actor self, FrozenActor target, Color color, bool display)
{
if (self.Owner != self.World.LocalPlayer)
return;
self.World.AddFrameEndTask(w =>
{
if (self.Disposed)
return;
target.Flash();
var line = self.TraitOrDefault<DrawLineToTarget>();
if (line != null)
line.SetTarget(self, Target.FromPos(target.CenterPosition), color, display);
});
}
}
}