From ff4e874d47aaa01a5d453706c5d89874baf339c8 Mon Sep 17 00:00:00 2001 From: Niklas Ulf Anders Cullberg Date: Tue, 9 Oct 2012 16:19:44 +0200 Subject: [PATCH] Made that last more efficient... --- DepthsBelow/DepthsBelow/MouseInput.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/DepthsBelow/DepthsBelow/MouseInput.cs b/DepthsBelow/DepthsBelow/MouseInput.cs index 59f87e5..f581d93 100755 --- a/DepthsBelow/DepthsBelow/MouseInput.cs +++ b/DepthsBelow/DepthsBelow/MouseInput.cs @@ -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().Goal = Grid.WorldToGrid(mouseWorldPos); + if (checkingDirection == false) + { + foreach (var unit in core.Squad) + if (unit.Selected) + { + unit.GetComponent().Goal = Grid.WorldToGrid(mouseWorldPos); } - } + } } if (ms.RightButton == ButtonState.Pressed)