diff --git a/OpenRA.Mods.RA2/Traits/BaseSpawnerParent.cs b/OpenRA.Mods.RA2/Traits/BaseSpawnerParent.cs index 2539d209e..0ef8641b6 100644 --- a/OpenRA.Mods.RA2/Traits/BaseSpawnerParent.cs +++ b/OpenRA.Mods.RA2/Traits/BaseSpawnerParent.cs @@ -202,14 +202,17 @@ void INotifyActorDisposing.Disposing(Actor self) public virtual void SpawnIntoWorld(Actor self, Actor child, WPos centerPosition) { var exit = self.RandomExitOrDefault(self.World, null); - SetSpawnedFacing(child, self, exit); + SetSpawnedFacing(child, exit); self.World.AddFrameEndTask(w => { if (self.IsDead) return; - var spawnOffset = exit == null ? WVec.Zero : exit.Info.SpawnOffset; + var spawnOffset = WVec.Zero; + if (exit != null) + spawnOffset = exit.Info.SpawnOffset.Rotate(new WRot(WAngle.Zero, WAngle.Zero, WAngle.FromFacing(64 - facing.Facing))); + child.Trait().SetVisualPosition(child, centerPosition + spawnOffset); var location = self.World.Map.CellContaining(centerPosition + spawnOffset); @@ -223,7 +226,7 @@ public virtual void SpawnIntoWorld(Actor self, Actor child, WPos centerPosition) }); } - void SetSpawnedFacing(Actor spawned, Actor spawner, Exit exit) + void SetSpawnedFacing(Actor spawned, Exit exit) { var facingOffset = facing == null ? 0 : facing.Facing;