fixed soundspam
This commit is contained in:
@@ -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);
|
||||
})));
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user