From 831d474f5161fb2f870f8b901c230049fd2629fe Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Mon, 9 Nov 2009 18:08:19 +1300 Subject: [PATCH] #21 fixed --- OpenRa.Game/Controller.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OpenRa.Game/Controller.cs b/OpenRa.Game/Controller.cs index e0f11c45ce..f82e68ca83 100644 --- a/OpenRa.Game/Controller.cs +++ b/OpenRa.Game/Controller.cs @@ -69,6 +69,14 @@ namespace OpenRa.Game else orderGenerator = new UnitOrderGenerator( Game.SelectUnitOrBuilding(Game.CellSize * xy)); + + var voicedUnit = ((UnitOrderGenerator)orderGenerator).selection + .Select(a => a.traits.GetOrDefault()) + .Where(m => m != null && m.self.Owner == Game.LocalPlayer) + .FirstOrDefault(); + + if (voicedUnit != null) + Game.PlaySound(Game.SovietVoices.Second.GetNext() + GetVoiceSuffix(voicedUnit.self), false); } dragStart = dragEnd = xy;