From 40deda74ab152350580a65a9527991d09e895993 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Fri, 31 Mar 2023 15:45:14 +1100 Subject: [PATCH] Fix docking config in some instances (#15005) --- Content.Server/Shuttles/Systems/DockingSystem.Shuttle.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Content.Server/Shuttles/Systems/DockingSystem.Shuttle.cs b/Content.Server/Shuttles/Systems/DockingSystem.Shuttle.cs index f72a1df252..f1bb320780 100644 --- a/Content.Server/Shuttles/Systems/DockingSystem.Shuttle.cs +++ b/Content.Server/Shuttles/Systems/DockingSystem.Shuttle.cs @@ -75,7 +75,7 @@ public sealed partial class DockingSystem if (!ValidSpawn(grid, shuttleDockedAABB.Value)) return false; - gridRotation = targetGridRotation + gridDockAngle - shuttleDockAngle; + gridRotation = (targetGridRotation + gridDockAngle - shuttleDockAngle).Reduced(); return true; } @@ -162,7 +162,7 @@ public sealed partial class DockingSystem var spawnPosition = new EntityCoordinates(targetGrid, matty.Transform(Vector2.Zero)); spawnPosition = new EntityCoordinates(targetGridXform.MapUid!.Value, spawnPosition.ToMapPos(EntityManager, _transform)); - var dockedBounds = new Box2Rotated(shuttleAABB.Translated(spawnPosition.Position), targetGridAngle, spawnPosition.Position); + var dockedBounds = new Box2Rotated(shuttleAABB.Translated(spawnPosition.Position), targetAngle, spawnPosition.Position); // Check if there's no intersecting grids (AKA oh god it's docking at cargo). if (_mapManager.FindGridsIntersecting(targetGridXform.MapID, @@ -180,8 +180,6 @@ public sealed partial class DockingSystem (dockUid, gridDockUid, shuttleDock, gridDock), }; - // TODO: Check shuttle orientation as the tiebreaker. - foreach (var (otherUid, other) in shuttleDocks) { if (other == shuttleDock) -- 2.51.2