Move Shroud.IsTargetable to Player.

This commit is contained in:
Paul Chote
2015-06-13 18:27:00 +01:00
parent 1eb1841f2b
commit 0677c309f3
7 changed files with 26 additions and 28 deletions

View File

@@ -61,7 +61,7 @@ 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.HasTrait<FrozenUnderFog>() && !self.Owner.Shroud.IsTargetable(Target.Actor))
if (!attack.Info.IgnoresVisibility && type == TargetType.Actor && !Target.Actor.HasTrait<FrozenUnderFog>() && !self.Owner.CanTargetActor(Target.Actor))
return NextActivity;
// Try to move within range

View File

@@ -156,7 +156,7 @@ namespace OpenRA.Mods.Common.Traits
a.AppearsHostileTo(self) &&
!a.HasTrait<AutoTargetIgnore>() &&
attack.HasAnyValidWeapons(Target.FromActor(a)) &&
self.Owner.Shroud.IsTargetable(a))
self.Owner.CanTargetActor(a))
.ClosestTo(self);
}
}

View File

@@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits
public override int GetSelectionShares(Actor collector)
{
// don't ever hide the map for people who have GPS.
if (collector.Owner.Shroud.HasFogVisibility())
if (collector.Owner.HasFogVisibility)
return 0;
return base.GetSelectionShares(collector);