Cache FrozenActor ITargetable.TargetTypes union

This commit is contained in:
atlimit8
2015-07-16 11:47:16 -05:00
parent 6986cd9f0e
commit fadfd179cb
5 changed files with 10 additions and 10 deletions

View File

@@ -75,8 +75,7 @@ namespace OpenRA.Mods.Common.Warheads
return false;
// A target type is valid if it is in the valid targets list, and not in the invalid targets list.
var targetable = victim.Info.Traits.WithInterface<ITargetableInfo>();
if (!IsValidTarget(targetable.SelectMany(t => t.GetTargetTypes())))
if (!IsValidTarget(victim.TargetTypes))
return false;
return true;