Actor properties consistency improved

This commit is contained in:
huwpascoe
2014-11-10 14:20:19 +00:00
parent 6a425b8636
commit a660bb95b5
58 changed files with 109 additions and 120 deletions

View File

@@ -81,7 +81,8 @@ namespace OpenRA.Graphics
if (Game.Settings.Game.TeamHealthColors)
{
var isAlly = actor.Owner.IsAlliedWith(actor.World.LocalPlayer)
|| (actor.IsDisguised() && actor.World.LocalPlayer.IsAlliedWith(actor.EffectiveOwner.Owner));
|| (actor.EffectiveOwner != null && actor.EffectiveOwner.Disguised
&& actor.World.LocalPlayer.IsAlliedWith(actor.EffectiveOwner.Owner));
return isAlly ? Color.LimeGreen : actor.Owner.NonCombatant ? Color.Tan : Color.Red;
}
else
@@ -137,13 +138,13 @@ namespace OpenRA.Graphics
public void BeforeRender(WorldRenderer wr) {}
public void Render(WorldRenderer wr)
{
if (!actor.IsInWorld || actor.IsDead())
if (!actor.IsInWorld || actor.IsDead)
return;
var health = actor.TraitOrDefault<Health>();
var screenPos = wr.ScreenPxPosition(pos);
var bounds = actor.Bounds.Value;
var bounds = actor.Bounds;
bounds.Offset(screenPos.X, screenPos.Y);
var xy = new float2(bounds.Left, bounds.Top);

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Graphics
readonly Color color;
public SelectionBoxRenderable(Actor actor, Color color)
: this(actor.CenterPosition, actor.Bounds.Value, 1f, color) { }
: this(actor.CenterPosition, actor.Bounds, 1f, color) { }
public SelectionBoxRenderable(WPos pos, Rectangle bounds, float scale, Color color)
{