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);