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

@@ -157,7 +157,7 @@ namespace OpenRA.Mods.Cnc.Traits
var targetUnits = power.UnitsInRange(xy).Where(a => !world.FogObscures(a));
foreach (var unit in targetUnits)
if (manager.Self.Owner.CanTargetActor(unit))
if (unit.CanBeViewedByPlayer(manager.Self.Owner))
yield return new SelectionBoxRenderable(unit, Color.Red);
}
@@ -250,7 +250,7 @@ namespace OpenRA.Mods.Cnc.Traits
// Unit previews
foreach (var unit in power.UnitsInRange(sourceLocation))
{
if (manager.Self.Owner.CanTargetActor(unit))
if (unit.CanBeViewedByPlayer(manager.Self.Owner))
{
var targetCell = unit.Location + (xy - sourceLocation);
var canEnter = manager.Self.Owner.Shroud.IsExplored(targetCell) &&
@@ -260,13 +260,13 @@ namespace OpenRA.Mods.Cnc.Traits
}
var offset = world.Map.CenterOfCell(xy) - world.Map.CenterOfCell(sourceLocation);
if (manager.Self.Owner.CanTargetActor(unit))
if (unit.CanBeViewedByPlayer(manager.Self.Owner))
foreach (var r in unit.Render(wr))
yield return r.OffsetBy(offset);
}
foreach (var unit in power.UnitsInRange(sourceLocation))
if (manager.Self.Owner.CanTargetActor(unit))
if (unit.CanBeViewedByPlayer(manager.Self.Owner))
yield return new SelectionBoxRenderable(unit, Color.Red);
}