Add ActorInfo.HasTraitInfo<T>() requiring ITraitInfo types
This commit is contained in:
@@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
void ActorRemoved(Actor a)
|
||||
{
|
||||
if (a.Owner != Self.Owner || !a.Info.Traits.Contains<SupportPowerInfo>())
|
||||
if (a.Owner != Self.Owner || !a.Info.HasTraitInfo<SupportPowerInfo>())
|
||||
return;
|
||||
|
||||
foreach (var t in a.TraitsImplementing<SupportPower>())
|
||||
@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public IEnumerable<SupportPowerInstance> GetPowersForActor(Actor a)
|
||||
{
|
||||
if (a.Owner != Self.Owner || !a.Info.Traits.Contains<SupportPowerInfo>())
|
||||
if (a.Owner != Self.Owner || !a.Info.HasTraitInfo<SupportPowerInfo>())
|
||||
return NoInstances;
|
||||
|
||||
return a.TraitsImplementing<SupportPower>()
|
||||
|
||||
Reference in New Issue
Block a user