From 0fdb2a395eb88a5289af19ce8d6b1286e92e0afb Mon Sep 17 00:00:00 2001 From: Debug Date: Fri, 29 Sep 2023 20:38:18 +0200 Subject: [PATCH] Reimplement pallet selling --- Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs index 80e7cf71e09..cbe7b7078d3 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs @@ -329,9 +329,16 @@ private void OnPalletSale(EntityUid uid, CargoPalletConsoleComponent component, return; } - SellPallets(gridUid, null, out var price); - var stackPrototype = _protoMan.Index(component.CashType); - _stack.Spawn((int) price, stackPrototype, uid.ToCoordinates()); + // Delta-V change, on sale, add cash to the stations bank account instead of throwing it on the floor + var stationUid = _station.GetOwningStation(uid); + + if (TryComp(stationUid, out var bank)) + { + SellPallets(gridUid, null, out var amount); + bank.Balance += (int) amount; + } + // End of Delta-V change + UpdatePalletConsoleInterface(uid); }