From 73c8c6e5a57483314ee781d6076ee60b8ab5f45b Mon Sep 17 00:00:00 2001 From: Whatstone <166147148+whatston3@users.noreply.github.com> Date: Sun, 18 Aug 2024 19:42:33 -0400 Subject: [PATCH] Align dungeon with largest grid (#1879) --- .../Salvage/SpawnSalvageMissionJob.cs | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/Content.Server/Salvage/SpawnSalvageMissionJob.cs b/Content.Server/Salvage/SpawnSalvageMissionJob.cs index d9d198a1bb2..698dc55a0ea 100644 --- a/Content.Server/Salvage/SpawnSalvageMissionJob.cs +++ b/Content.Server/Salvage/SpawnSalvageMissionJob.cs @@ -231,29 +231,9 @@ protected override async Task Process() Box2 shuttleBox = new Box2(); if (shuttleUid is { Valid: true } vesselUid && - _entManager.TryGetComponent(vesselUid, out var vesselXform)) + _entManager.TryGetComponent(vesselUid, out var gridComp)) { - foreach (var gridUid in stationData.Grids) - { - if (!_entManager.TryGetComponent(gridUid, out var gridComp)) - continue; - - MapCoordinates mapBottomLeft = _xforms.ToMapCoordinates(EntityCoordinatesExtensions.ToCoordinates(gridUid, gridComp.LocalAABB.BottomLeft)); - MapCoordinates mapTopRight = _xforms.ToMapCoordinates(EntityCoordinatesExtensions.ToCoordinates(gridUid, gridComp.LocalAABB.TopRight)); - EntityCoordinates shuttleBottomLeft = _xforms.ToCoordinates((vesselUid, vesselXform), mapBottomLeft); - EntityCoordinates shuttleTopRight = _xforms.ToCoordinates((vesselUid, vesselXform), mapTopRight); - - //IsEmpty check needed so box won't contain 0, 0 - if (!shuttleBox.IsEmpty()) - { - shuttleBox = shuttleBox.ExtendToContain(shuttleBottomLeft.Position); - shuttleBox = shuttleBox.ExtendToContain(shuttleTopRight.Position); - } - else - { - shuttleBox = new Box2(shuttleBottomLeft.Position, shuttleTopRight.Position); - } - } + shuttleBox = gridComp.LocalAABB; } // Frontier: offset ship spawn point from bounding boxes