Made that last more efficient...

This commit is contained in:
Niklas Ulf Anders Cullberg
2012-10-09 16:19:44 +02:00
parent 7ea3b0be99
commit ff4e874d47
+7 -6
View File
@@ -107,13 +107,14 @@ namespace DepthsBelow
// Send orders with right click
if (ms.RightButton == ButtonState.Released && lastMouseState.RightButton == ButtonState.Pressed)
{
foreach (var unit in core.Squad)
if (unit.Selected)
{
if (checkingDirection == false) {
unit.GetComponent<Component.PathFinder>().Goal = Grid.WorldToGrid(mouseWorldPos);
if (checkingDirection == false)
{
foreach (var unit in core.Squad)
if (unit.Selected)
{
unit.GetComponent<Component.PathFinder>().Goal = Grid.WorldToGrid(mouseWorldPos);
}
}
}
}
if (ms.RightButton == ButtonState.Pressed)