From e9656795a20c3b77ff0cedd804c3db0e749e50c5 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 22 May 2012 19:22:22 +1200 Subject: [PATCH] RenderCargo depends on IMove on the containing actor --- OpenRA.Mods.Cnc/RenderCargo.cs | 6 +++--- OpenRA.Mods.RA/Crate.cs | 9 +++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/OpenRA.Mods.Cnc/RenderCargo.cs b/OpenRA.Mods.Cnc/RenderCargo.cs index 874c73edfc..d621ab4bc9 100644 --- a/OpenRA.Mods.Cnc/RenderCargo.cs +++ b/OpenRA.Mods.Cnc/RenderCargo.cs @@ -24,20 +24,20 @@ namespace OpenRA.Mods.Cnc { Cargo cargo; IFacing facing; - IHasLocation location; + IMove move; public RenderCargo(Actor self) { cargo = self.Trait(); facing = self.TraitOrDefault(); - location = self.Trait(); + move = self.Trait(); } public IEnumerable ModifyRender(Actor self, IEnumerable r) { foreach (var c in cargo.Passengers) { - c.Trait().SetPxPosition( c, location.PxPosition ); + c.Trait().SetPxPosition( c, move.PxPosition ); var cargoFacing = c.TraitOrDefault(); if (facing != null && cargoFacing != null) diff --git a/OpenRA.Mods.RA/Crate.cs b/OpenRA.Mods.RA/Crate.cs index 53f33a8fdd..5324a12287 100644 --- a/OpenRA.Mods.RA/Crate.cs +++ b/OpenRA.Mods.RA/Crate.cs @@ -38,13 +38,10 @@ namespace OpenRA.Mods.RA class Crate : ITick, IOccupySpace, ITeleportable, ICrushable, ISync { readonly Actor self; - [Sync] - int ticks; - - [Sync] - public int2 Location; - + [Sync] int ticks; + [Sync] public int2 Location; CrateInfo Info; + public Crate(ActorInitializer init, CrateInfo info) { this.self = init.self;