Fix sales by making ATS station-owned (#3494)

This commit is contained in:
pathetic meowmeow 2025-04-17 10:53:04 -04:00 committed by GitHub
parent b00a9a721b
commit 1ecd07319d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 3 deletions

View File

@ -6,6 +6,7 @@ using Content.Server.Station.Systems;
using Content.Shared.Cargo.Components;
using Content.Shared.CCVar;
using Content.Shared.Shuttles.Components;
using Content.Shared.Station.Components;
using Content.Shared.Tiles;
using Content.Shared.Whitelist;
using Robust.Shared.Configuration;
@ -46,7 +47,7 @@ public sealed partial class CargoSystem
return;
if (_gridFillEnabled)
SetupTradePost();
SetupTradePost(args);
}
private void SetGridFill(bool enabled)
@ -54,11 +55,11 @@ public sealed partial class CargoSystem
_gridFillEnabled = enabled;
if (enabled && _ticker.RunLevel != GameRunLevel.PreRoundLobby) // Ensure run level is in game
{
SetupTradePost();
SetupTradePost(null);
}
}
private void SetupTradePost()
private void SetupTradePost(StationInitializedEvent? args)
{
if (Exists(CargoMap))
return;
@ -78,6 +79,10 @@ public sealed partial class CargoSystem
var gridUid = grid.Value;
EnsureComp<ProtectedGridComponent>(gridUid);
EnsureComp<TradeStationComponent>(gridUid);
if (args is { } arg)
{
EnsureComp<StationMemberComponent>(gridUid).Station = arg.Station;
}
var shuttleComp = EnsureComp<ShuttleComponent>(gridUid);
shuttleComp.AngularDamping = 10000;