Fix unit turret vs War Factory roof rendering.

This commit is contained in:
Paul Chote
2013-05-19 11:09:28 +12:00
parent 170e14546a
commit f7aca32e0e
2 changed files with 6 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenRA.Graphics; using OpenRA.Graphics;
using OpenRA.Traits; using OpenRA.Traits;
using OpenRA.Mods.RA.Buildings;
namespace OpenRA.Mods.RA.Render namespace OpenRA.Mods.RA.Render
{ {
@@ -48,7 +49,10 @@ namespace OpenRA.Mods.RA.Render
: base(init, info) : base(init, info)
{ {
roof = new Animation(GetImage(init.self)); roof = new Animation(GetImage(init.self));
anims.Add("roof", new AnimationWithOffset(roof, null, () => !buildComplete, 24));
var bi = init.self.Info.Traits.Get<BuildingInfo>();
anims.Add("roof", new AnimationWithOffset(roof, null,
() => !buildComplete, FootprintUtils.CenterOffset(bi).Y));
} }
public void BuildingComplete( Actor self ) public void BuildingComplete( Actor self )

View File

@@ -53,7 +53,7 @@ namespace OpenRA.Mods.RA.Render
anim = new Animation(rs.GetImage(self), () => t.turretFacing); anim = new Animation(rs.GetImage(self), () => t.turretFacing);
anim.Play(info.Sequence); anim.Play(info.Sequence);
rs.anims.Add("turret_{0}".F(info.Turret), new AnimationWithOffset( rs.anims.Add("turret_{0}".F(info.Turret), new AnimationWithOffset(
anim, () => TurretOffset(self), null, 24)); anim, () => TurretOffset(self), null, t.Offset.Length));
} }
WVec TurretOffset(Actor self) WVec TurretOffset(Actor self)