clean up Contrail trait lookups; fixes #1058
This commit is contained in:
@@ -31,23 +31,24 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
ContrailInfo Info = null;
|
ContrailInfo Info = null;
|
||||||
Turret ContrailTurret = null;
|
Turret ContrailTurret = null;
|
||||||
|
ContrailHistory history;
|
||||||
ContrailHistory history;
|
IFacing facing;
|
||||||
|
IMove move;
|
||||||
|
|
||||||
public Contrail(Actor self, ContrailInfo info)
|
public Contrail(Actor self, ContrailInfo info)
|
||||||
{
|
{
|
||||||
Info = info;
|
Info = info;
|
||||||
ContrailTurret = new Turret(Info.ContrailOffset);
|
ContrailTurret = new Turret(Info.ContrailOffset);
|
||||||
history = new ContrailHistory(Info.TrailLength, Info.UsePlayerColor ? ContrailHistory.ChooseColor(self) : Info.Color);
|
history = new ContrailHistory(Info.TrailLength,
|
||||||
|
Info.UsePlayerColor ? ContrailHistory.ChooseColor(self) : Info.Color);
|
||||||
|
facing = self.Trait<IFacing>();
|
||||||
|
move = self.Trait<IMove>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick(Actor self)
|
public void Tick(Actor self)
|
||||||
{
|
{
|
||||||
var facing = self.Trait<IFacing>();
|
history.Tick(self.CenterLocation - new int2(0, move.Altitude)
|
||||||
var altitude = new float2(0, self.Trait<IMove>().Altitude);
|
- Combat.GetTurretPosition(self, facing, ContrailTurret));
|
||||||
|
|
||||||
var pos = self.CenterLocation - Combat.GetTurretPosition(self, facing, ContrailTurret) - altitude;
|
|
||||||
history.Tick(pos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RenderAfterWorld(WorldRenderer wr, Actor self) { history.Render(self); }
|
public void RenderAfterWorld(WorldRenderer wr, Actor self) { history.Render(self); }
|
||||||
|
|||||||
Reference in New Issue
Block a user