Add ActorInfo.HasTraitInfo<T>() requiring ITraitInfo types
This commit is contained in:
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common
|
||||
if (self.IsDead)
|
||||
return false;
|
||||
|
||||
if (!self.Info.Traits.Contains<IOccupySpace>())
|
||||
if (!self.Info.HasTraitInfo<IOccupySpaceInfo>())
|
||||
return false;
|
||||
|
||||
if (!self.IsInWorld)
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common
|
||||
if (stance == Stance.Ally)
|
||||
return true;
|
||||
|
||||
if (self.EffectiveOwner != null && self.EffectiveOwner.Disguised && !toActor.Info.Traits.Contains<IgnoresDisguiseInfo>())
|
||||
if (self.EffectiveOwner != null && self.EffectiveOwner.Disguised && !toActor.Info.HasTraitInfo<IgnoresDisguiseInfo>())
|
||||
return toActor.Owner.Stances[self.EffectiveOwner.Owner] == Stance.Ally;
|
||||
|
||||
return stance == Stance.Ally;
|
||||
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common
|
||||
if (stance == Stance.Ally)
|
||||
return false; /* otherwise, we'll hate friendly disguised spies */
|
||||
|
||||
if (self.EffectiveOwner != null && self.EffectiveOwner.Disguised && !toActor.Info.Traits.Contains<IgnoresDisguiseInfo>())
|
||||
if (self.EffectiveOwner != null && self.EffectiveOwner.Disguised && !toActor.Info.HasTraitInfo<IgnoresDisguiseInfo>())
|
||||
return toActor.Owner.Stances[self.EffectiveOwner.Owner] == Stance.Enemy;
|
||||
|
||||
return stance == Stance.Enemy;
|
||||
|
||||
Reference in New Issue
Block a user