Move some Station methods into shared (#38976)

This commit is contained in:
Nemanja
2025-08-08 11:22:34 -04:00
committed by GitHub
parent 3d9e1f64a9
commit 1374ceea47
41 changed files with 298 additions and 351 deletions

View File

@@ -11,7 +11,6 @@ using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Events;
using Content.Server.Spawners.Components;
using Content.Server.Spawners.EntitySystems;
using Content.Server.Station.Components;
using Content.Server.Station.Events;
using Content.Server.Station.Systems;
using Content.Shared.Administration;
@@ -224,7 +223,7 @@ public sealed class ArrivalsSystem : EntitySystem
if (component.FirstRun)
{
var station = _station.GetLargestGrid(Comp<StationDataComponent>(component.Station));
var station = _station.GetLargestGrid(component.Station);
sourceMap = station == null ? null : Transform(station.Value)?.MapUid;
arrivalsDelay += RoundStartFTLDuration;
component.FirstRun = false;
@@ -470,7 +469,7 @@ public sealed class ArrivalsSystem : EntitySystem
{
while (query.MoveNext(out var uid, out var comp, out var shuttle, out var xform))
{
if (comp.NextTransfer > curTime || !TryComp<StationDataComponent>(comp.Station, out var data))
if (comp.NextTransfer > curTime)
continue;
var tripTime = _shuttles.DefaultTravelTime + _shuttles.DefaultStartupTime;
@@ -486,7 +485,7 @@ public sealed class ArrivalsSystem : EntitySystem
// Go to station
else
{
var targetGrid = _station.GetLargestGrid(data);
var targetGrid = _station.GetLargestGrid(comp.Station);
if (targetGrid != null)
_shuttles.FTLToDock(uid, shuttle, targetGrid.Value);