.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

@@ -105,8 +105,8 @@ namespace OpenRA.Mods.Common.Traits
bool CanBeCapturedBy(Actor a)
{
var pc = a.TraitOrDefault<ProximityCaptor>();
return pc != null && pc.HasAny(Info.CaptorTypes);
var pc = a.Info.Traits.GetOrDefault<ProximityCaptorInfo>();
return pc != null && pc.Types.Overlaps(Info.CaptorTypes);
}
IEnumerable<Actor> UnitsInRange()