Cache FrozenActor ITargetable.TargetTypes union
This commit is contained in:
@@ -138,8 +138,7 @@ namespace OpenRA.GameRules
|
||||
/// <summary>Checks if the weapon is valid against (can target) the frozen actor.</summary>
|
||||
public bool IsValidAgainst(FrozenActor victim, Actor firedBy)
|
||||
{
|
||||
var targetable = victim.Info.Traits.WithInterface<ITargetableInfo>();
|
||||
if (!IsValidTarget(targetable.SelectMany(t => t.GetTargetTypes())))
|
||||
if (!IsValidTarget(victim.TargetTypes))
|
||||
return false;
|
||||
|
||||
if (!Warheads.Any(w => w.IsValidAgainst(victim, firedBy)))
|
||||
|
||||
Reference in New Issue
Block a user