Add ActorInfo.HasTraitInfo<T>() requiring ITraitInfo types

This commit is contained in:
atlimit8
2015-08-02 12:44:46 -05:00
parent 85fab45451
commit 8162fa27ab
77 changed files with 138 additions and 136 deletions

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
public void ActorChanged(Actor a)
{
var bi = a.Info.Traits.GetOrDefault<BuildableInfo>();
if (a.Owner == player && (a.Info.Traits.Contains<ITechTreePrerequisiteInfo>() || (bi != null && bi.BuildLimit > 0)))
if (a.Owner == player && (a.Info.HasTraitInfo<ITechTreePrerequisiteInfo>() || (bi != null && bi.BuildLimit > 0)))
Update();
}