Track per-player frozen actors.

This commit is contained in:
Paul Chote
2013-08-07 13:48:23 +12:00
parent c3bcca2ff7
commit eef941fd42
10 changed files with 277 additions and 74 deletions

View File

@@ -120,6 +120,24 @@ namespace OpenRA.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.Destroyed)
return;
target.Flash();
var line = self.TraitOrDefault<DrawLineToTarget>();
if (line != null)
line.SetTarget(self, Target.FromPos(target.CenterPosition), color, display);
});
}
}
}