Provide HasStance extension method for Stance enum, to avoid overhead of HasFlag method.

This commit is contained in:
RoosterDragon
2015-07-14 20:01:29 +01:00
parent 6113892276
commit 3a0eb5554e
6 changed files with 16 additions and 8 deletions

View File

@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Warheads
return false;
var stance = firedBy.Owner.Stances[victim.Owner];
if (!ValidStances.HasFlag(stance))
if (!ValidStances.HasStance(stance))
return false;
// A target type is valid if it is in the valid targets list, and not in the invalid targets list.
@@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Warheads
// AffectsParent checks do not make sense for FrozenActors, so skip to stance checks
var stance = firedBy.Owner.Stances[victim.Owner];
if (!ValidStances.HasFlag(stance))
if (!ValidStances.HasStance(stance))
return false;
// A target type is valid if it is in the valid targets list, and not in the invalid targets list.