Remove Player.CanViewActor and .CanTargetActor.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user