Fix Positions returned by FrozenActor targets.
Also removes redundant Targetables check from actors.
This commit is contained in:
committed by
Oliver Brakmann
parent
31f4b0a5c4
commit
5995915281
@@ -43,6 +43,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public Player Owner { get; private set; }
|
||||
public BitSet<TargetableType> TargetTypes { get; private set; }
|
||||
public WPos[] TargetablePositions { get; private set; }
|
||||
|
||||
public ITooltipInfo TooltipInfo { get; private set; }
|
||||
public Player TooltipOwner { get; private set; }
|
||||
@@ -118,6 +119,7 @@ namespace OpenRA.Traits
|
||||
{
|
||||
Owner = actor.Owner;
|
||||
TargetTypes = actor.GetEnabledTargetTypes();
|
||||
TargetablePositions = actor.GetTargetablePositions().ToArray();
|
||||
Hidden = !actor.CanBeViewedByPlayer(viewer);
|
||||
|
||||
if (health != null)
|
||||
|
||||
@@ -183,12 +183,9 @@ namespace OpenRA.Traits
|
||||
switch (Type)
|
||||
{
|
||||
case TargetType.Actor:
|
||||
if (!actor.Targetables.Any(Exts.IsTraitEnabled))
|
||||
return new[] { actor.CenterPosition };
|
||||
|
||||
return actor.GetTargetablePositions();
|
||||
case TargetType.FrozenActor:
|
||||
return new[] { frozen.CenterPosition };
|
||||
return frozen.TargetablePositions;
|
||||
case TargetType.Terrain:
|
||||
return terrainPositions;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user