Fix cargo shuttle (#10397)
This commit is contained in:
@@ -6,6 +6,7 @@ using Content.Server.Shuttles.Events;
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Server.Paper;
|
||||
using Content.Server.Shuttles.Systems;
|
||||
using Content.Server.Station.Components;
|
||||
using Content.Shared.Cargo;
|
||||
using Content.Shared.Cargo.BUI;
|
||||
using Content.Shared.Cargo.Components;
|
||||
@@ -358,13 +359,22 @@ public sealed partial class CargoSystem
|
||||
/// </summary>
|
||||
public void CallShuttle(StationCargoOrderDatabaseComponent orderDatabase)
|
||||
{
|
||||
if (!TryComp<CargoShuttleComponent>(orderDatabase.Shuttle, out var shuttle) ||
|
||||
!TryComp<TransformComponent>(orderDatabase.Owner, out var xform)) return;
|
||||
if (!TryComp<CargoShuttleComponent>(orderDatabase.Shuttle, out var shuttle))
|
||||
return;
|
||||
|
||||
// Already called / not available
|
||||
if (shuttle.NextCall == null || _timing.CurTime < shuttle.NextCall)
|
||||
return;
|
||||
|
||||
if (!TryComp<StationDataComponent>(orderDatabase.Owner, out var stationData))
|
||||
return;
|
||||
|
||||
var targetGrid = _station.GetLargestGrid(stationData);
|
||||
|
||||
// Nowhere to warp in to.
|
||||
if (!TryComp<TransformComponent>(targetGrid, out var xform))
|
||||
return;
|
||||
|
||||
shuttle.NextCall = null;
|
||||
|
||||
// Find a valid free area nearby to spawn in on
|
||||
|
||||
Reference in New Issue
Block a user