Fix docking config in some instances (#15005)
This commit is contained in:
@@ -75,7 +75,7 @@ public sealed partial class DockingSystem
|
|||||||
if (!ValidSpawn(grid, shuttleDockedAABB.Value))
|
if (!ValidSpawn(grid, shuttleDockedAABB.Value))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
gridRotation = targetGridRotation + gridDockAngle - shuttleDockAngle;
|
gridRotation = (targetGridRotation + gridDockAngle - shuttleDockAngle).Reduced();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ public sealed partial class DockingSystem
|
|||||||
var spawnPosition = new EntityCoordinates(targetGrid, matty.Transform(Vector2.Zero));
|
var spawnPosition = new EntityCoordinates(targetGrid, matty.Transform(Vector2.Zero));
|
||||||
spawnPosition = new EntityCoordinates(targetGridXform.MapUid!.Value, spawnPosition.ToMapPos(EntityManager, _transform));
|
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).
|
// Check if there's no intersecting grids (AKA oh god it's docking at cargo).
|
||||||
if (_mapManager.FindGridsIntersecting(targetGridXform.MapID,
|
if (_mapManager.FindGridsIntersecting(targetGridXform.MapID,
|
||||||
@@ -180,8 +180,6 @@ public sealed partial class DockingSystem
|
|||||||
(dockUid, gridDockUid, shuttleDock, gridDock),
|
(dockUid, gridDockUid, shuttleDock, gridDock),
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Check shuttle orientation as the tiebreaker.
|
|
||||||
|
|
||||||
foreach (var (otherUid, other) in shuttleDocks)
|
foreach (var (otherUid, other) in shuttleDocks)
|
||||||
{
|
{
|
||||||
if (other == shuttleDock)
|
if (other == shuttleDock)
|
||||||
|
|||||||
Reference in New Issue
Block a user