Convert Attack*.FacingTolerance to WAngle.
This commit is contained in:
@@ -18,8 +18,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Unit got to face the target")]
|
||||
public class AttackFrontalInfo : AttackBaseInfo, Requires<IFacingInfo>
|
||||
{
|
||||
[Desc("Tolerance for attack angle. Range [0, 128], 128 covers 360 degrees.")]
|
||||
public readonly new int FacingTolerance = 0;
|
||||
[Desc("Tolerance for attack angle. Range [0, 512], 512 covers 360 degrees.")]
|
||||
public readonly new WAngle FacingTolerance = WAngle.Zero;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new AttackFrontal(init.Self, this); }
|
||||
}
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (!base.CanAttack(self, target))
|
||||
return false;
|
||||
|
||||
return TargetInFiringArc(self, target, 4 * Info.FacingTolerance);
|
||||
return TargetInFiringArc(self, target, Info.FacingTolerance);
|
||||
}
|
||||
|
||||
public override Activity GetAttackActivity(Actor self, AttackSource source, in Target newTarget, bool allowMove, bool forceAttack, Color? targetLineColor = null)
|
||||
|
||||
Reference in New Issue
Block a user