diff --git a/OpenRa.Game/Sidebar.cs b/OpenRa.Game/Sidebar.cs index 6db4875f58..5ef12c8517 100644 --- a/OpenRa.Game/Sidebar.cs +++ b/OpenRa.Game/Sidebar.cs @@ -162,19 +162,24 @@ namespace OpenRa.Game if( mi.Button == MouseButtons.Left && mi.Event == MouseInputEvent.Down ) { - string group = Rules.UnitCategory[ item.Tag ]; - if (player.Producing(group) == null) - { - var ui = Rules.UnitInfo[item.Tag]; - var time = ui.Cost - * .8f /* Game.BuildSpeed */ /* todo: country-specific build speed bonus */ - * (25 * 60) /* frames per min */ /* todo: build acceleration, if we do that */ - / 1000; + string group = Rules.UnitCategory[ item.Tag ]; + var producing = player.Producing(group); + if (producing == null) + { + var ui = Rules.UnitInfo[item.Tag]; + var time = ui.Cost + * .8f /* Game.BuildSpeed */ /* todo: country-specific build speed bonus */ + * (25 * 60) /* frames per min */ /* todo: build acceleration, if we do that */ + / 1000; - player.BeginProduction( group, - new ProductionItem( item.Tag, (int)time, ui.Cost ) ); - Build(item); - } + player.BeginProduction(group, + new ProductionItem(item.Tag, (int)time, ui.Cost)); + //Build(item); + } + else if (producing.Item == item.Tag) + { + Build(item); + } } else if( mi.Button == MouseButtons.Right && mi.Event == MouseInputEvent.Down ) player.CancelProduction( Rules.UnitCategory[ item.Tag ] ); diff --git a/OpenRa.Game/UnitOrders.cs b/OpenRa.Game/UnitOrders.cs index 854d495dba..821f391eab 100755 --- a/OpenRa.Game/UnitOrders.cs +++ b/OpenRa.Game/UnitOrders.cs @@ -62,6 +62,8 @@ namespace OpenRa.Game Game.controller.orderGenerator = null; Game.worldRenderer.uiOverlay.KillOverlay(); + + order.Player.FinishProduction(Rules.UnitCategory[building.Name]); } ); break; }