Remove Player.CanViewActor and .CanTargetActor.

This commit is contained in:
Paul Chote
2017-10-05 16:59:42 +00:00
committed by reaperrr
parent 47634b25f9
commit 1376ad674e
10 changed files with 14 additions and 22 deletions

View File

@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Activities
var pos = self.CenterPosition;
var targetPos = attackHeli.GetTargetPosition(pos, target);
if (attackOnlyVisibleTargets && target.Type == TargetType.Actor && canHideUnderFog
&& !self.Owner.CanTargetActor(target.Actor))
&& !target.Actor.CanBeViewedByPlayer(self.Owner))
{
var newTarget = Target.FromCell(self.World, self.World.Map.CellContaining(targetPos));

View File

@@ -90,7 +90,9 @@ namespace OpenRA.Mods.Common.Activities
// HACK: This would otherwise break targeting frozen actors
// The problem is that Shroud.IsTargetable returns false (as it should) for
// frozen actors, but we do want to explicitly target the underlying actor here.
if (!attack.Info.IgnoresVisibility && type == TargetType.Actor && !Target.Actor.Info.HasTraitInfo<FrozenUnderFogInfo>() && !self.Owner.CanTargetActor(Target.Actor))
if (!attack.Info.IgnoresVisibility && type == TargetType.Actor
&& !Target.Actor.Info.HasTraitInfo<FrozenUnderFogInfo>()
&& !Target.Actor.CanBeViewedByPlayer(self.Owner))
return NextActivity;
// Drop the target once none of the weapons are effective against it

View File

@@ -85,7 +85,7 @@ namespace OpenRA.Mods.Common.Activities
// Target moved under the fog. Move to its last known position.
if (Target.Type == TargetType.Actor && canHideUnderFog
&& !self.Owner.CanTargetActor(Target.Actor))
&& !Target.Actor.CanBeViewedByPlayer(self.Owner))
{
if (inner != null)
inner.Cancel(self);