Skip to content

Commit

Permalink
clickable spawnpoint polish
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisforbes committed Jun 13, 2010
1 parent 5d66c6b commit 27902bc
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions OpenRA.Game/Widgets/MapPreviewWidget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ public override bool HandleInput(MouseInput mi)
{
var container = new Rectangle(DrawPosition().X, DrawPosition().Y, Parent.Bounds.Width, Parent.Bounds.Height);

var points = Game.chrome.currentMap.Waypoints
var p = Game.chrome.currentMap.Waypoints
.Select((sp, i) => Pair.New(Game.chrome.currentMap.ConvertToPreview(sp.Value, container), i))
.Where(a => ClientForSpawnpoint(a.Second) == null && (a.First - mi.Location).LengthSquared < closeEnough)
.ToArray();
.Select(a => a.Second + 1)
.FirstOrDefault();

if (points.Length > 0)
Game.IssueOrder(Order.Chat("/spawn {0}".F(points[0].Second + 1)));

return points.Length > 0;
Game.IssueOrder(Order.Chat("/spawn {0}".F(p)));
return true;
}

return false;
Expand Down

0 comments on commit 27902bc

Please sign in to comment.