.Trait[OrDefault]<Trait> => .Info.Traits.Get[OrDefault]<TraitInfo> where applicable

This commit is contained in:
atlimit8
2015-08-02 18:31:57 -05:00
parent 8162fa27ab
commit 6970959ef1
16 changed files with 55 additions and 81 deletions

View File

@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits
public bool CanBeTargetedBy(Actor captor, Player owner)
{
var c = captor.TraitOrDefault<Captures>();
var c = captor.Info.Traits.GetOrDefault<CapturesInfo>();
if (c == null)
return false;
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits
if (playerRelationship == Stance.Neutral && !AllowNeutral)
return false;
if (!c.Info.CaptureTypes.Contains(Type))
if (!c.CaptureTypes.Contains(Type))
return false;
return true;