RenderCargo depends on IMove on the containing actor
This commit is contained in:
@@ -24,20 +24,20 @@ namespace OpenRA.Mods.Cnc
|
|||||||
{
|
{
|
||||||
Cargo cargo;
|
Cargo cargo;
|
||||||
IFacing facing;
|
IFacing facing;
|
||||||
IHasLocation location;
|
IMove move;
|
||||||
|
|
||||||
public RenderCargo(Actor self)
|
public RenderCargo(Actor self)
|
||||||
{
|
{
|
||||||
cargo = self.Trait<Cargo>();
|
cargo = self.Trait<Cargo>();
|
||||||
facing = self.TraitOrDefault<IFacing>();
|
facing = self.TraitOrDefault<IFacing>();
|
||||||
location = self.Trait<IHasLocation>();
|
move = self.Trait<IMove>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r)
|
public IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r)
|
||||||
{
|
{
|
||||||
foreach (var c in cargo.Passengers)
|
foreach (var c in cargo.Passengers)
|
||||||
{
|
{
|
||||||
c.Trait<ITeleportable>().SetPxPosition( c, location.PxPosition );
|
c.Trait<ITeleportable>().SetPxPosition( c, move.PxPosition );
|
||||||
|
|
||||||
var cargoFacing = c.TraitOrDefault<IFacing>();
|
var cargoFacing = c.TraitOrDefault<IFacing>();
|
||||||
if (facing != null && cargoFacing != null)
|
if (facing != null && cargoFacing != null)
|
||||||
|
|||||||
@@ -38,13 +38,10 @@ namespace OpenRA.Mods.RA
|
|||||||
class Crate : ITick, IOccupySpace, ITeleportable, ICrushable, ISync
|
class Crate : ITick, IOccupySpace, ITeleportable, ICrushable, ISync
|
||||||
{
|
{
|
||||||
readonly Actor self;
|
readonly Actor self;
|
||||||
[Sync]
|
[Sync] int ticks;
|
||||||
int ticks;
|
[Sync] public int2 Location;
|
||||||
|
|
||||||
[Sync]
|
|
||||||
public int2 Location;
|
|
||||||
|
|
||||||
CrateInfo Info;
|
CrateInfo Info;
|
||||||
|
|
||||||
public Crate(ActorInitializer init, CrateInfo info)
|
public Crate(ActorInitializer init, CrateInfo info)
|
||||||
{
|
{
|
||||||
this.self = init.self;
|
this.self = init.self;
|
||||||
|
|||||||
Reference in New Issue
Block a user