From 9c520e07b13b95ed36e9be90c3d2b1d3c3f6c43b Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Mon, 11 Jan 2010 22:15:54 +1300 Subject: [PATCH] more --- OpenRa.Game/Orders/ChronosphereSelectOrderGenerator.cs | 6 ++---- OpenRa.Game/Orders/IronCurtainOrderGenerator.cs | 6 ++---- OpenRa.Game/Sound.cs | 3 ++- 3 files changed, 6 insertions(+), 9 deletions(-) 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];