diff --git a/OpenRa.Game/UnitOrders.cs b/OpenRa.Game/UnitOrders.cs index 9c478f137b..386fdf8bb9 100755 --- a/OpenRa.Game/UnitOrders.cs +++ b/OpenRa.Game/UnitOrders.cs @@ -105,14 +105,19 @@ namespace OpenRa.Game if (!Rules.TechTree.BuildableItems(order.Player, group).Contains(order.TargetString)) return; /* you can't build that!! */ + bool hasPlayedSound = false; + order.Player.BeginProduction(group, new ProductionItem(order.TargetString, (int)time, ui.Cost, () => Game.world.AddFrameEndTask( _ => { var isBuilding = group == "Building" || group == "Defense"; - if (order.Player == Game.LocalPlayer) - Game.PlaySound( isBuilding ? "conscmp1.aud" : "unitrdy1.aud", false); + if (!hasPlayedSound && order.Player == Game.LocalPlayer) + { + Game.PlaySound(isBuilding ? "conscmp1.aud" : "unitrdy1.aud", false); + hasPlayedSound = true; + } if (!isBuilding) Game.BuildUnit(order.Player, order.TargetString); }))); diff --git a/OpenRa.sln b/OpenRa.sln index cf7e9ed56d..2d8e00e87b 100644 --- a/OpenRa.sln +++ b/OpenRa.sln @@ -142,6 +142,7 @@ Global {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug (x86)|Mixed Platforms.ActiveCfg = Debug|Any CPU {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug (x86)|Mixed Platforms.Build.0 = Debug|Any CPU {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug (x86)|Win32.ActiveCfg = Debug|Any CPU + {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug (x86)|Win32.Build.0 = Debug|Any CPU {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Any CPU.Build.0 = Debug|Any CPU {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU