Fixed left-click breaking build order.

This commit is contained in:
Matthew Bowra-Dean
2009-10-09 01:35:01 +13:00
parent f6eb20bbf8
commit 02f0b882cb

View File

@@ -30,7 +30,8 @@ namespace OpenRa.Game
var xy = GetWorldPos(mi); var xy = GetWorldPos(mi);
if (mi.Button == MouseButtons.Left && mi.Event == MouseInputEvent.Down) if (mi.Button == MouseButtons.Left && mi.Event == MouseInputEvent.Down)
{ {
dragStart = dragEnd = xy; if (!(orderGenerator is PlaceBuilding))
dragStart = dragEnd = xy;
} }
if (mi.Button == MouseButtons.Left && mi.Event == MouseInputEvent.Move) if (mi.Button == MouseButtons.Left && mi.Event == MouseInputEvent.Move)
@@ -39,10 +40,13 @@ namespace OpenRa.Game
if (mi.Button == MouseButtons.Left && mi.Event == MouseInputEvent.Up) if (mi.Button == MouseButtons.Left && mi.Event == MouseInputEvent.Up)
{ {
if (dragStart.HasValue && !(dragStart.Value == GetWorldPos(mi))) if (!(orderGenerator is PlaceBuilding))
orderGenerator = FindUnit(dragStart.Value, xy); /* band-box select */ {
else if (dragStart.HasValue && !(dragStart.Value == GetWorldPos(mi)))
orderGenerator = FindUnit(xy, xy); /* click select */ orderGenerator = FindUnit(dragStart.Value, xy); /* band-box select */
else
orderGenerator = FindUnit(xy, xy); /* click select */
}
dragStart = dragEnd = null; dragStart = dragEnd = null;
} }