diff --git a/OpenRa.Game/Traits/CanPowerDown.cs b/OpenRa.Game/Traits/CanPowerDown.cs index 0f19527739..a43a50f14b 100644 --- a/OpenRa.Game/Traits/CanPowerDown.cs +++ b/OpenRa.Game/Traits/CanPowerDown.cs @@ -34,7 +34,8 @@ namespace OpenRa.Traits if (order.OrderString == "PowerDown") { IsDisabled = !IsDisabled; - Sound.Play((IsDisabled) ? "bleep12.aud" : "bleep11.aud"); + if (self.Owner == self.World.LocalPlayer) + Sound.Play(IsDisabled ? "bleep12.aud" : "bleep11.aud"); } } } diff --git a/OpenRa.Game/Traits/Production.cs b/OpenRa.Game/Traits/Production.cs index 989f2ae1e3..bc4ffb004a 100755 --- a/OpenRa.Game/Traits/Production.cs +++ b/OpenRa.Game/Traits/Production.cs @@ -95,7 +95,9 @@ namespace OpenRa.Traits } } isPrimary = true; - Sound.Play("pribldg1.aud"); + + if (self.Owner == self.World.LocalPlayer) + Sound.Play("pribldg1.aud"); } } } diff --git a/OpenRa.Game/Traits/RenderBuilding.cs b/OpenRa.Game/Traits/RenderBuilding.cs index 1e0e41a5e7..4bbe74540d 100644 --- a/OpenRa.Game/Traits/RenderBuilding.cs +++ b/OpenRa.Game/Traits/RenderBuilding.cs @@ -95,7 +95,9 @@ namespace OpenRa.Traits public void Selling( Actor self ) { anim.PlayBackwardsThen( "make", null ); - Sound.Play("cashturn.aud"); + + if (self.Owner == self.World.LocalPlayer) + Sound.Play("cashturn.aud"); } public void Sold(Actor self) { DoBib(self, true); } diff --git a/OpenRa.Game/Traits/SonarPulsePower.cs b/OpenRa.Game/Traits/SonarPulsePower.cs index 7caa3fe088..899d138b87 100644 --- a/OpenRa.Game/Traits/SonarPulsePower.cs +++ b/OpenRa.Game/Traits/SonarPulsePower.cs @@ -10,21 +10,28 @@ namespace OpenRa.Traits public override object Create(Actor self) { return new SonarPulsePower(self, this); } } - public class SonarPulsePower : SupportPower + public class SonarPulsePower : SupportPower, IResolveOrder { public SonarPulsePower(Actor self, SonarPulsePowerInfo info) : base(self, info) { } protected override void OnBeginCharging() { } protected override void OnFinishCharging() { Sound.Play("pulse1.aud"); } + protected override void OnActivate() { - // Question: Is this method synced? or does it have to go via an order? - - // TODO: Reveal submarines - - // Should this play for all players? - Sound.Play("sonpulse.aud"); - FinishActivate(); + Game.orderManager.IssueOrder(new Order("SonarPulse", Owner.PlayerActor)); + } + + public void ResolveOrder(Actor self, Order order) + { + if (order.OrderString == "SonarPulse") + { + // TODO: Reveal submarines + + // Should this play for all players? + Sound.Play("sonpulse.aud"); + FinishActivate(); + } } } }