Replace IPreventsAutoTarget with IDisable(Enemy)AutoTarget.
This allows traits on the attacking unit to suppress auto targeting and makes the distinction between the two interfaces clear.
This commit is contained in:
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class CaptureManager : INotifyCreated, INotifyCapture, ITick, IPreventsAutoTarget
|
||||
public class CaptureManager : INotifyCreated, INotifyCapture, ITick, IDisableEnemyAutoTarget
|
||||
{
|
||||
readonly CaptureManagerInfo info;
|
||||
ConditionManager conditionManager;
|
||||
@@ -283,7 +283,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
w.Update(currentTarget, self, currentTarget, currentTargetDelay, currentTargetTotal);
|
||||
}
|
||||
|
||||
bool IPreventsAutoTarget.PreventsAutoTarget(Actor self, Actor attacker)
|
||||
bool IDisableEnemyAutoTarget.DisableEnemyAutoTarget(Actor self, Actor attacker)
|
||||
{
|
||||
return info.PreventsAutoTarget && currentCaptors.Any(c => attacker.AppearsFriendlyTo(c));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user