diff --git a/OpenRa.Game/Orders/ChronosphereSelectOrderGenerator.cs b/OpenRa.Game/Orders/ChronosphereSelectOrderGenerator.cs index 889965abbc..bc59e480c5 100644 --- a/OpenRa.Game/Orders/ChronosphereSelectOrderGenerator.cs +++ b/OpenRa.Game/Orders/ChronosphereSelectOrderGenerator.cs @@ -31,11 +31,9 @@ namespace OpenRa.Game.Orders var underCursor = Game.FindUnits(loc, loc) .Where(a => a.Owner == Game.LocalPlayer && a.traits.WithInterface().Any() - && a.LegacyInfo.Selectable).FirstOrDefault(); + && a.traits.Contains()).FirstOrDefault(); - var unit = underCursor != null ? underCursor.LegacyInfo as LegacyUnitInfo : null; - - if (unit != null) + if (underCursor != null) yield return new Order("ChronosphereSelect", underCursor, null, int2.Zero, power.Name); } } diff --git a/OpenRa.Game/Orders/IronCurtainOrderGenerator.cs b/OpenRa.Game/Orders/IronCurtainOrderGenerator.cs index a33d67587e..2d56000335 100644 --- a/OpenRa.Game/Orders/IronCurtainOrderGenerator.cs +++ b/OpenRa.Game/Orders/IronCurtainOrderGenerator.cs @@ -31,11 +31,9 @@ namespace OpenRa.Game.Orders var underCursor = Game.FindUnits(loc, loc) .Where(a => a.Owner == Game.LocalPlayer && a.traits.Contains() - && a.LegacyInfo.Selectable).FirstOrDefault(); + && a.traits.Contains()).FirstOrDefault(); - var unit = underCursor != null ? underCursor.LegacyInfo as LegacyUnitInfo : null; - - if (unit != null) + if (underCursor != null) yield return new Order("IronCurtain", underCursor, null, int2.Zero, power.Name); } } diff --git a/OpenRa.Game/Sound.cs b/OpenRa.Game/Sound.cs index f3dea39130..6c773d0ae0 100644 --- a/OpenRa.Game/Sound.cs +++ b/OpenRa.Game/Sound.cs @@ -2,6 +2,7 @@ using IrrKlang; using OpenRa.FileFormats; using OpenRa.Game.GameRules; +using OpenRa.Game.Traits; namespace OpenRa.Game { @@ -92,7 +93,7 @@ namespace OpenRa.Game { if (voicedUnit == null) return; - var mi = voicedUnit.LegacyInfo as LegacyMobileInfo; + var mi = voicedUnit.Info.Traits.GetOrDefault(); if (mi == null) return; var vi = Rules.VoiceInfo[mi.Voice];