Set carried turret facing on delivery.

This commit is contained in:
Paul Chote
2016-08-27 17:08:33 +01:00
parent 017020f2c3
commit c3c6af018a

View File

@@ -187,6 +187,13 @@ namespace OpenRA.Mods.Common.Activities
var targetPosition = self.CenterPosition + body.LocalToWorld(localOffset);
var targetLocation = self.World.Map.CellContaining(targetPosition);
positionable.SetPosition(carryall.Carryable, targetLocation, SubCell.FullCell);
// HACK: directly manipulate the turret facings to match the new orientation
// This can eventually go away, when we make turret facings relative to the body
var facingDelta = carryallFacing.Facing - carryableFacing.Facing;
foreach (var t in carryall.Carryable.TraitsImplementing<Turreted>())
t.TurretFacing += facingDelta;
carryableFacing.Facing = carryallFacing.Facing;
// Put back into world