Remove LINQ in some performance critical AutoTarget paths.

This commit is contained in:
RoosterDragon
2015-10-17 00:51:45 +01:00
parent dcf375a412
commit 0fab3ec1b2
3 changed files with 45 additions and 13 deletions

View File

@@ -132,10 +132,11 @@ namespace OpenRA.GameRules
if (!IsValidTarget(targetTypes))
return false;
if (!Warheads.Any(w => w.IsValidAgainst(victim, firedBy)))
return false;
foreach (var warhead in Warheads)
if (warhead.IsValidAgainst(victim, firedBy))
return true;
return true;
return false;
}
/// <summary>Checks if the weapon is valid against (can target) the frozen actor.</summary>